Access Project Directory in Yii

Standard

For get Directory :-

Yii::app()->getBaseUrl(true);        –     Get Http path

Yii::app()->getBaseUrl(false);       –  Get /var/www/ Path

Yii::app()->params[‘site_url’] ;

Yii::app()->baseUrl;                  – upto projectName Directory

 

Yii::app()->createAbsoluteUrl(‘site/contact’)

Ex: http://localhost/ProjectName/site/contact

Yii::app()->getBaseUrl(true);

EX : http://localhost/Projectname

Yii::app()->getBaseUrl(false);

EX : /Projectname

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s