Closed 01011 closed 10 years ago
Do you mind sharing your code?
Thanks @01011
FileInput.php renderTemplate() method:
public function renderTemplate($field)
{
$params = ['field' => $field];
switch($this->style)
{
case static::STYLE_INPUT:
$view = $this->getViewPath() . '/inputField.php';
break;
case static::STYLE_BUTTON:
$view = $this->getViewPath() . '/buttonField.php';
break;
case static::STYLE_IMAGE:
$view = $this->getViewPath() . '/imageField.php';
$params['thumbnail'] = $this->thumbnail;
break;
case static::STYLE_CUSTOM:
if($this->customView === null) {
throw new InvalidConfigException(
'"FileInput::$customView" must be set if "FileInput::STYLE_CUSTOM" is used'
);
}
$view = $this->customView;
$params['thumbnail'] = $this->thumbnail; // here
break;
default:
throw new InvalidConfigException(
'Unrecognized "FileInput::$style" format. ' .
'It should be of "FileInput::STYLE_INPUT", "FileInput::STYLE_BUTTON", ' .
'"FileInput::STYLE_IMAGE" or "FileInput only.');
}
return $this->getView()->renderFile(Yii::getAlias($view), $params);
}
@01011 I think you are on the wrong library: https://github.com/2amigos/yii2-file-input-widget
:)
@tonydspaniard yes, now i see )
Hello. When i using custom view file, there is no $thumbnail. Probably, because missing line:
in: