Thanks for reading! I’m trying to figure out a way to gracefully and safely process forms (post variables).
In Codeigniter there’s a vibe where you can say:
$username = $this->input->post(‘username’);
…and that will fetch the posted variable which happens to have a key of ‘username’. However, you can also add the word ‘true’, like this:
$username = $this->input->post(‘username’, true);
By simply adding the word ‘true’, you send the username variable through an impressive and extensive chunk of code, all dedicated to making sure the variable is safe.
I was just wondering, does Yii2 have a similar feature?
I’ve had a look around the web and I can’t find anything similar for Yii2. This page from the userguide doesn’t seem to discuss it and - as a matter of fact - I found a thread HERE in which a very important person says that Yii doesn’t provide a sanitization feature. However, that was an old post and perhaps things have changed.
Can anyone shed any light on this? My only goal is to process basic forms - taking in post variables - as safely as possible.