How to Set Base URL in Yii Framework

后端 未结 7 1875
情深已故
情深已故 2021-02-15 00:48

When I do

print_r(Yii::app()->request->baseUrl)

I get an empty string. A post on the Yii forum says this is blank by default. How can I c

7条回答
  •  青春惊慌失措
    2021-02-15 01:00

    Yii::app()->baseUrl returns just a relative Path from the url to index.php for example: 127.0.0.1/index.php returns '' 127.0.0.1/yii/index.php returns '/yii'

提交回复
热议问题