More are to come and they will all be under protected/extensions/widgets/{FOLDERNAME}/{CLASSNAME}.
Where {FOLDERNAME} is always the same as {CLASSNAME}.
Is there a way to shortcut the class name/path like
<?php $this->widget("widgets.{FOLDERNAME}"); ?>
so that Yii will go and search for the widgets directory in protected/extensions and load the class with the same name (as the folder) from the folder?
Can/should I extend the createWidget() method of CBaseController? And where would I put the extendes CBaseController?
Thank you Gustavo. setPathOfAlias work’s great for the application.extensions.widgets path.
I am still looking for a perfect solution to shorten CountryDropdown.CountryDropdown. The way you mention with setPathOfAlias is great, but this forces me to set the path for every widget manually in the config.
In case someone with the same problem will find this thread:
Yii::getPathOfAlias (and other methods like Yii::app()->basePath) don’t work in the config files, because it seems the Yii class is not yet instantiated(?).
have the same issue over here. As my widgets have multiple view files, I want to keep these in a separate map. But with the current widget configuration, you have to put in the name of the widget twice. No autoloading of the central widget file. Any ideas?