How Do I Add An Extension To My Module?

As the title indicates, I’m trying to add an extension to a module that I am developing for an office intranet site. I am currently adding the YiiBooster extension which is a form of the boostrap extension. I have a few more extensions that I would like to add once I am successful at this one.

I have downloaded and saved the extension under /protected/modules/myModule/extenstions/bootstrap. In the myModule.php file, I’ve added the following code:

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










It seems the only line of code that is doing anything is the setPathOfAlias. I can comment out the configure line and the preloadComponents() line and nothing changes on my site. Maybe I need to move this code to somewhere else?

in this link same problem discussed and solved

check changing the path dir(FILE).‘extensions/bootstrap’

Rajith, I had a typo in my original post and it is corrected now. Great suggestion!

Kumar, thank you for this link. I tried adding a config/main.php file and adding the Yii::app()->setComponents to my init() function. This was helpful but I would rather not add a config/main.php file.

This post is what I am using now. It does not require me to add the configuration file. Thanks everyone!