Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
How to pass or how to process a request from a Post? All this is described in detail in the documentation.
print_r($_GET);
print_r($_POST);
look what will be there,
this is already the equivalent of \Yii::$app->request->post();
Например, данные поля из формы передаем методом post:
Форма во view-файле:
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'name')->textInput() ?>
<?= Html::submitButton('Создать', ['class' => 'btn btn-success']) ?>
<?php ActiveForm::end(); ?>
public function actionSomeAction()
{
$model = new SomeForm();
if ($model->load(Yii::$app->request->post())) {
... делаем что нужно ...
}
return $this->render('someview', [
'model' => $model,
]);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question