M
M
Maxim2016-06-06 14:44:53
Yii
Maxim, 2016-06-06 14:44:53

How can I access the id of an input in a form from a controller?

There is a created form, each input in this form has its own id.
How can I get the id of the input in the controller?

<?php $form = ActiveForm::begin(); ?>

        <?= $form->field($updateForm, 'updateEx')->textInput(array('value'=>$item['name'], 'id' => $item['id']))->label('');?>

        <a href="<?php echo Url::toRoute(['site/ex-delete', 'id' => $item['id']]) ?>" >Удалить</a>

    <div class="form-group">
        <?= Html::submitButton('Отправить', ['class' => 'btn btn-primary']) ?>
    </div>

        <?php ActiveForm::end(); ?>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
enchikiben, 2016-06-06
@EnChikiben

like this www.yiiframework.com/doc-2.0/yii-helpers-basehtml....

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question