Paths in Yii

来源:互联网 发布:淘宝售后流程表 编辑:程序博客网 时间:2024/06/07 01:15

{basePath}

1echo Yii::app()->basePath;

path/to/protected

{like} /YiiBlog/protected

{theme baseUrl}

1echo Yii::app()->theme->baseUrl;

path/to/themes/themeName

{like} /YiiBlog/themes

{request baseUrl}

1echo Yii::app()->request->baseUrl;
2path/to/projectFolder
3{like}/YiiBlog


{full URL}

1http://localhost/yii_lab/index.php?r=lab/urlBoyLeeTest

 

{Yii::app()->request->hostInfo}

1echo(Yii::app()->request->hostInfo);
2//out => http://localhost

 

{createUrl()}

1echo $this->createUrl('urlBoyLeeTest');
2//out => /yii_lab/index.php?r=lab/urlBoyLeeTest

 

{createAbsoluteUrl()}

1echo $this->createAbsoluteUrl('urlBoyLeeTest');
2//out => http://localhost/yii_lab/index.php?r=lab/urlBoyLeeTest
3//A+B ^&^