Yii常用路径说明

原作者地址:http://www.kuitao8.com/20140520/2483.shtml

//framework路径 Yii::getFrameworkPath(); //protected/runtime Yii::app()->getRuntimePath(); //在view中得到当前controller的ID方法: Yii::app()->getController()->id; //在view中得到当前action的ID方法 Yii::app()->getController()->getAction()->id; //yii获取ip地址 Yii::app()->request->userHostAddress; //yii判断提交方式 Yii::app()->request->isPostRequest; //得到当前域名: Yii::app()->request->hostInfo; //得到proteced目录的物理路径 Yii::app()->basePath; //获得上一页的url以返回 Yii::app()->request->urlReferrer; //得到当前url Yii::app()->request->url; //得到当前home url Yii::app()->homeUrl; //得到当前return url Yii::app()->user->returnUrl //项目路径 dirname(Yii::app()->BasePath);
posted @ 2016-09-22 10:31  不解凡忧  Views(667)  Comments(0Edit  收藏  举报