I have a module which has its own controller and models and would like to import the controllers, views and models of the protected folder i.e. protected/controllers , protected/views , protected/model.
I want to use the functionality of my module along with the ones in protected.
In your module file, let’s say MyOwnModule.php (that means your module is named eg MyOwn) override CModule.init() method:
public function init()
{
// this method is called when the module is being created
// you may place code here to customize the module or the application
// import the module-level models and components
$this->setImport(array(
'myOwn.models.*',
'myOwn.components.*',
));
}
This code is generated by Gii.
And all code in your application (that is from protected directory) is automatically available to your module.