How do i point to homepage using CHtml?
I tried CHtml::link('go home',array(''))
but it seems to point to current page.
I want to point to index.php only.
How can i do this ?
尝试CHtml :: link('/',array(''))
您也可以使用Yii :: app()-> request-> getBaseUrl(true)
Try this :-
echo Chtml::link('Go Home', '/');
This is tested and it works.
只需使用Yii :: app()-> homeUrl
echo CHtml::link('go home',array(Yii::app()->homeUrl));
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.