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
Post a Comment