Modular Extensions - (HMVC) - Version 3.1.9 |
[eluser]wiredesignz[/eluser]
Current Version is 3.1.0 Modular Extensions is now two files: helpers/modules_helper.php libraries/modular_extensions.php A few nice features are worth mentioning: Controllers, Models and of course Modules can load files from any other module directory. Code: //loading a HMVC Module into a Controller, two options. Same process for Views and Libraries, just specify the module directory and sub-directory as above. A file is available for download: http://codeigniter.com/wiki/File:modular...s_310.zip/ Feedback is appreciated. Thank you for your interest. ![]()
[eluser]wiredesignz[/eluser]
Current Version is 3.1.2 The Modular Extension directories can now be organised with proper structure. Config, Controllers Libraries, Models, Views, Helpers and Plugins are supported. A file is available for download: http://codeigniter.com/wiki/File:modular...s_312.zip/ Feedback is appreciated. Thank you for your interest ![]()
[eluser]wiredesignz[/eluser]
Current Version is 3.1.3 Available on the wiki: http://codeigniter.com/wiki/Modular_Extensions_-_HMVC/ A file is available for download: http://codeigniter.com/wiki/File:modular...s_313.zip/ Feedback is appreciated. ![]()
[eluser]Edemilson Lima[/eluser]
I have a view that runs a module: Code: <div class="publish"><?=modules::run('adsense',NULL,'button')?></div> Code: // application/modules/adsense.php: Code: Unable to load the requested module:
[eluser]wiredesignz[/eluser]
Yes that still is a feature. The error indicates it can't find your adsense module in the path its searching. check it's location and filename. application/modules/adsense/controllers/adsense.php
[eluser]Edemilson Lima[/eluser]
application/modules/adsense/controllers/adsense.php ? I did place it at: application/modules/adsense.php If I want my modules to load the views, models, libraries, helpers and plugins from their original directories, can't be the modules directory used like any other directory in CI? I was thinking I could put my modules on it, and even create more custom folders into the modules directory, to organize my modules. CI works with the application directories as repositories, where it loads the files. Shouldn't the modules directory work this way too? ![]()
[eluser]wiredesignz[/eluser]
The modules are HMVC applications with their own controllers, models, views etc. Calling a module controller such as Adsense.php is a call to a HMVC controller, just like CI calls its own controllers. You pass controller name, data, and method. You can use original CI models, libraries and views from modules by using `$this->load->` method as normal. If you want to a module use its own resources or resources of other modules you use the `$this->load->module->` method. Hope this helps. ![]()
[eluser]Edemilson Lima[/eluser]
Hmmmm... I see. I already knew that it have a support for a full HMVC, but I did think it will keep the original idea of using modules as partials, without they need to have such MVC structure. Is not possible to change the actual version to use modules this way too?
[eluser]wiredesignz[/eluser]
Yes, if you modify modules_helper.php it will not use the controllers directory unless you specify. Code: function & load($modules, $dir = 'controllers/') //remove `controllers/`
[eluser]Edemilson Lima[/eluser]
What about if it check if the module exists in the path "application/modules/$module.php", and if it was not found there, then it try to load from the "application/modules/$module/controllers/$module.php"? By this way will be better to use Modular Extensions only for rendering partials. I think many people will use it only for this purpose. Then the module in "application/modules/$module.php" will load views, models, libraries, helpers and plugins only from the original CI folders. Is this possible? |
Welcome Guest, Not a member yet? Register Sign In |