php - Yii2 : Yii::$app->request->baseUrl not working in Linux -


its strange me, want base url in may main.php layout file. put code in main.php file.

<?php var_dump(yii::$app->request->baseurl); ?> 

output:

string '/unfactory-v2/web' (length=17) 

the same code when execute in linux system it's getting empty. like

string '' (length=0) 

why not working linux??

i'm use yii 2.

in yii2 can use:

url::base() 

or

url::home() 

or

yii::$app->homeurl 

even better, can use path aliases (http://www.yiiframework.com/wiki/667/yii-2-list-of-path-aliases-available-with-default-basic-and-advanced-app/)


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -