php - Yii - simplify retrieving the $_POST var data using getPost() -


i have following yii code , minimise if possible:

$request = yii::app()->request->getpost('request'); $username = $request['model']['username']; 

is possible minimise have work on single line instance? (note code below doesn't work)

$username = yii::app()->request->getpost('request['model']['username']');  

as can see below (in class chttprequest):

public function getpost($name,$defaultvalue=null) {     return isset($_post[$name]) ? $_post[$name] : $defaultvalue; } 

if can put in $name, returned :d


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -