mcirkova
(M Cirkova)
1
Hi , in the _form.php data i have this:
<?= $form->field($model, ‘email’)->textInput([‘maxlength’ => 45]) ?>
This is from Person model , so i want that value from input to get in my controller, i try this :
print_r($_POST);
exit();
But it return empty array.
Any help please.
ricardo_rm
(Rrmontuan)
2
Hi mcirkova!
Could you please post your view and controller? that way it’s gonna be easy to help you.
ps: Don’t forget to use the code snippet.
Best regards,
Ricardo
josdel91
(Tedjoujospin)
3
Hi,
you can’t display things from controller. it is the View role.
The better way to test whether a form has been submitted is a condition in the controllet i think. But your controller and View code will tell more!
ilaiyaraja
(Ilaiyamdu)
4
It will work at any case.
print_r(Yii::$app->request->post());
I am not clear about why $_POST is not working, But it may be due to your config.
check it.
bobonov
(Bobonov)
5
Are you sure your form button does a submit?
Try to check what is sent to the server at browser level, like using firebug extension.