Summary of Common Paths in Yii

//YII framework path
Yii::getFrameworkPath();

//protected/runtime
Yii::app()->getRuntimePath();

//Get the ID method of the current controller in the view:
Yii::app()->getController()->id;

//Get the ID method of the current action in the view
Yii::app()->getController()->getAction()->id;

//yii get ip address
Yii::app()->request->userHostAddress;

//yii judges the submission method
Yii::app()->request->isPostRequest;

//Get the current domain name:
Yii::app()->request->hostInfo;

//Get the physical path of the protected directory
Yii::app()->basePath;

//Get the url of the previous page to return
Yii::app()->request->urlReferrer;

// get the current url
Yii::app()->request->url;

// get the current home url
Yii::app()->homeUrl;

//get the current return url
Yii::app()->user->returnUrl

// project path
dirname(Yii::app()->BasePath);

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326887870&siteId=291194637