Are there any advantages of Yii::app()->request->getPost()
over $_POST
?
I feel it makes the code too much object oriented.
CHttpRequest::getPost()
checks if the parameter exists first and if not it returns a default value that you can pass to it.
Here is its actual implementation:
public function getPost($name,$defaultValue=null)
{
return isset($_POST[$name]) ? $_POST[$name] : $defaultValue;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With