Answer the question
In order to leave comments, you need to log in
How to get element attribute in extension?
I want to create an extension of this plugin for yii2, but I need to get the id attribute of the used field, relatively speaking
<?= $form->field($model, 'datapicker')->widget(Datapicker::classname(), [...]) ; ?>
I need to get the id of this field. Don't tell me how?
Answer the question
In order to leave comments, you need to log in
well, in the widget:
echo $this->id;
echo $this->counter;
echo $this->autoIdPrefix;
$this->autoIdPrefix = 'mySuperWidget';
echo $this->id;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question