I have a unique problem here.
I want to dynamically create Autocomplete Url for a lot of models.
At runtime I don’t know what Model class is being called beside one thing that it is a sub class of ActiveRecord.
I want to create a method in base ActiveRecord class which can create the Url based on model.
The problem arises when
some of the models are at the outermost layer of application.
some are in modules
and further some are in nested modules.
What I want to do is to check whether a particular model class is from module and create the standardized URL using the //autolist format.
The usual help about controller and module
$controller = Yii::app()->controller;
$module = $controller->module;
does not works for me because my request Url will be
Here the controller is always SettingController and no module is called.
However I want to get Autolist of following models.
application/models/Language application/models/Currency application/modules/accounts/models/Accounts application/modules/accounts/products/models/Product
Another way round is to have getAutocompleteUrl function in each of the above models which returns static urls… But that’s too cumbersome and also restricts future models to have such a function.
any help if appreciated.