Created
November 1, 2017 18:30
-
-
Save apphancer/d57108e6ab8eec57437d8d34b6137330 to your computer and use it in GitHub Desktop.
Yii Relative and Absolute URLs/Directories/Paths #yii1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// returns app absolute URL | |
var_dump(Yii::app()->getBaseUrl(true)); | |
// returns theme directory relative URL | |
var_dump(Yii::app()->theme->baseUrl); | |
// returns web relative URL | |
var_dump(Yii::app()->baseUrl); | |
// returns protected directory (server path) | |
var_dump(Yii::app()->basePath); | |
// returns web directory (server path) | |
var_dump(YiiBase::getPathOfAlias('webroot')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment