S
S
Sergey2015-04-22 02:54:28
Yii
Sergey, 2015-04-22 02:54:28

How to get POST data on Yii2 in Activeform?

I receive POST data, I need to process and save it, but I don't know how to implement it.
This is how I get the data

<input name="ik_co_id" value="<?php echo $ik_co_id = trim(stripslashes($_POST['ik_co_id']));  ?>" />

But if it's all fit in ActiveForm, then I get syntax errors, tell me how to do it?
I try like this, but complains about the brackets ['ik_co_id']
<?= Html::activeTextInput($model, 'ik_co_id', ['class'=>'form-item req', 'value' => "$_POST['ik_co_id']"]) ?>

Maybe there is some special ActiveForm method?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Pugovkin, 2015-04-22
@alekskondr

<?= Html::activeTextInput($model, 'ik_co_id', ['class'=>'form-item req', 'value' => "{$_POST['ik_co_id']}"]) ?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question