public function run()
{
if ($this->hasModel()) {
$name = Html::getInputName($this->model, $this->attribute);
$value = null;
if (is_array($this->model->{$this->attribute})) {
$value = StringHelper::base64EncodeUrl(serialize((array) $this->model->{$this->attribute}));
} else {
if (is_string($this->model->{$this->attribute})) {
$value = $this->model->{$this->attribute};
}
}
$this->options['id'] = Html::getInputId($this->model, $this->attribute);
//$element = Html::activeHiddenInput($this->model, $this->attribute, $this->options);
$element = Html::hiddenInput($name, $value, $this->options);
} else {
$element = Html::hiddenInput($this->name, $this->value, $this->options);
}
$this->registerPlugin();
$this->clientOptions['componentSelectId'] = $this->componentSelectId;
$this->clientOptions['componentSettingsId'] = Html::getInputId($this->model, $this->attribute);
$this->clientOptions['id'] = $this->id;
$this->clientOptions['backend'] = UrlHelper::construct('/cms/admin-universal-component-settings/index')->setSystemParam(Module::SYSTEM_QUERY_EMPTY_LAYOUT, 'true')->enableAdmin()->toString();
return $this->render('element', ['widget' => $this, 'element' => $element]);
}