Thursday, January 27, 2022

[FIXED] Get multidimensional post array via Yii getPost function

Issue

If i have a $_POST array as follows:

$_POST['request']['type']['user'] = 'abc';

How would I access this same variable using the Yii::app()->request->getPost() functionality built into Yii 1.x


Solution

Sussed it..

Yii::app()->request->getPost('request');
echo $request['type']['user'];


Answered By - Zabs

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.