Category Archives: yii

Yii : How to get raw POST

public function actionIndex() {
		//print_r($_POST);
		if (Yii::app()->request->isAjaxRequest) {
			$postdata = file_get_contents("php://input");
			if ($postdata) {
        		// do something
         		$outObj = array('success' => true);
      		echo CJSON::encode($outObj);
			}
		}
}

“php://input allows you to read raw POST data.
It is a less memory intensive alternative to $HTTP_RAW_POST_DATA and does not need any special php.ini directives.”
php://
took it from StackOverflow

Advertisements
Tagged , , ,

Yii : How to call a controller of a module

http://localhost/mmsx/index.php?r=mms/service

mms – module
service – controller

index action of service controller will be called

Tagged ,