Set Alias

I am using Mac and its built-in php.

In main.php, i did this

Yii::setPathOfAlias('bootstrap', dirname(__FILE__).'/../extensions/bootstrap');

but it does not work, so, in an index.php, i wrote:

<?php echo Yii::getPathOfAlias('bootstrap');?>

and the webpage show:


that’s wrong!

i think is should be


Please how to write the right "setPathOfAlias"?

now i change

Yii::setPathOfAlias('bootstrap', dirname(__FILE__).'/../extensions/bootstrap');


Yii::setPathOfAlias('bootstrap', dirname(dirname(__FILE__)).'/extensions/bootstrap');

so the output of

<?php echo Yii::getPathOfAlias('bootstrap');?>

turns to be


it seems right, because the fold is right one.


<?php $this->beginWidget('bootstrap.widgets.TbHeroUnit',array(

    'heading'=>'Welcome to '.CHtml::encode(Yii::app()->name),

)); ?>

still throws exception

[color="#FFA500"]Alias "bootstrap.widgets.TbHeroUnit" is invalid. Make sure it points to an existing PHP file and the file is readable. [/color]

can someone help me please?

problem solved!

the reason was ‘no permissions to access files’…


chmod 777 -R

Hi aslan,

Can you explain how you done it?

Thanks in advance :rolleyes: