-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing imports when generating modeldoc for modules #19
Comments
You can try putting the import path into your return array(
'import' => array(
'/path/to/ExampleModule/behaviors/*',
),
); |
That works ofcourse, but I was looking for a more generic way to improve this extension. Perhaps you can even consider scanning multiple paths: both application/models and every model folder in modules/? |
That won't work because the app would have to scan too many folders. I use composer and there are many things inside there that may or may not be behaviors. |
What about simply initializing all the application modules? foreach (Yii::app()->getModules() as $key=> $config) {
Yii::app()->getModule($key); // initializes module and loads imports
} |
I considered it, but decided against it. Now I can't remember why because it seems it should work. If you do a pull request and I'll test it out later today. |
I am trying to generate modeldocs for models contained in a Yii module. One of the modules' models points to a behavior class, also contained in the module. Module components are typically imported in the module's init() function.
When I try to run modeldoc with path 'application.modules.example.models' I get the following error:
ModelDocCode.php line 168 creates a new model, which attempts to load the behavior.
Do you have a suggestion how to solve the missing imports when generating modeldocs for a module?
The text was updated successfully, but these errors were encountered: