http://lxy.me/the-yii-access-to-the-current-url-and-domain-name.html
<?php
//当前域名
echo Yii::app()->request->hostInfo;
//除域名外的URL
echo Yii::app()->request->getUrl();
//除域名外的首页地址
echo Yii::app()->user->returnUrl;
//除域名外的根目录地址
echo Yii::app()->homeUrl;
?>
没有评论:
发表评论