I want to use a specific folder name for my module, but I don't really want it's name shown to the end user (ie: in the URL). I have tried to set the class name, but it tells me it doesn't exist when it is anything OTHER than what it's supposed to be. Please Note: The names have been changed in the example, but it gets the point across.
In my config:
'modules'=>array(
'cart'
),
In /protected/modules I have a folder ezcart. This is a module created by Gii. I can confirm, when I create "cart" with Gii, it works as expected.
The problem is, source wise I want the name of the folder ezcart to stay the same. It is the name of my package, which I will put on GitHub and share, and use for myself in the future. So anyone in the files know what is what, just like we keep the same names in the "vendors" etc.
So if I create ezcart with Gii, in my config.php, how do I tell Yii to use a different directory name. For example, I want to do this:
'modules'=>array(
'cart'=>array(
'class'=>'application.modules.ezcart'
)
),
However, it tells me it can't find ezcart. How can I get Yii to accept this naming difference?
You should use Url routing for this.. in your config/main.php add like this rule like this
see URL Management in the guide for some examples and what is all is possible using routing