I have a code similar to this to handle a form submission:
use \my-project\web\models\forms\RegisterOrganizationForm;
...
var_dump($_POST);die();
$model=new LoginForm;
if(isset($_POST['LoginForm']))
$model->attributes=$_POST['LoginForm'];
The output of that var_dump is (well, just the part regarding the values of the form):
[“\my-project\web\models\forms\LoginForm”]=> array(1) {…
As you can see the namespace has been added (I didn’t expect this..), so, how can I get just something like this below when vardumping??:
["LoginForm"]=> array(1) {...
Javier
First you are calling die() before you set the model attributes to the data received by the form.
Second you are doing a
var_dumpof$_POSTinstead dovar_dump$_POST['LoginForm']Third why do you want to do a var_dump if you want to see what is being sent back from the form use a tool like firebug for FireFox or developer tools in chrome