I want to make input field with tag using Input Tags Widget. But I got this error :
Either 'name', or 'model' and 'attribute' properties must be specified.
in /var/www/html/paramoor/vendor/yiisoft/yii2/widgets/InputWidget.php at line 75:
/**
* Initializes the widget.
* If you override this method, make sure you call the parent implementation first.
*/
public function init()
{
if ($this->name === null && !$this->hasModel()) {
throw new InvalidConfigException("Either 'name', or 'model' and 'attribute' properties must be specified.");
}
if (!isset($this->options['id'])) {
$this->options['id'] = $this->hasModel() ? Html::getInputId($this->model, $this->attribute) : $this->getId();
}
parent::init();
}
And here's my View Code :
<?= $form->field($modelDetail, 'product_id')->widget(TagsinputWidget::classname(),
[
'clientOptions' => [
'trimValue' => true,
'allowDuplicates' => false,
'delimiter' => ';',
],
]) ?>