...

World Wide Web Server 2012-07-04 16:07:04 -07:00
parent bf990524b8
commit 34852b73f7

@ -19,10 +19,13 @@ Also, I wanted as little impact on a standard CodeIgniter installation, as every
- Supports cross module calls, also to controller methods
- Uses standard CodeIgniter routing, no Router library modifications
- Introduces $this->load->module() via a Loader library extension
- [color=red]Support for both version 1.7.2 and 2.0[/color], [b]requires PHP5+[/b]
- Support for the default index() method and the _remap() method
- Support for the default index() method and the _remap() method when routing
- Supports loading models without CI object assignment, to support ORM libraries
- Supports module controller return values for true HMVC (as suggested by [url=http://codeigniter.com/forums/member/87583/]n0xie[/url])
- Supports module controller return values for true HMVC (as suggested by
- Allow loading of modules from alternate locations (p.e if you have a modules and a themes directory with a module structure)
- Allows loading your application folder as a module, so you can call these controllers too
[color=red]Supports both version 1.7.2 and 2.0[/color], [b]and requires PHP5+[/b]
[url=http://codeigniter.com/forums/member/87583/]n0xie[/url])
[b]Solution:[/b]
@ -41,6 +44,10 @@ If you have long and complex module names, or if your module name is variable (f
[code]// Make the "my_module_with_a_long_name" module available as 'my_module'
$this->load->module('my_module_with_a_long_name', 'my_module');[/code]
Or load a module from a specific location:
[code]// Make the "user_selected_theme" theme module available as 'theme'
$this->load->module('user_selected_theme', 'theme', APPPATH.'themes');[/code]
[i]A module remembers to location it is loaded from. After initializing it, you can change the module path without affecting the access to the modules methods.[/i]
This is all you have to do. From this moment on, all files from this module can be accessed in a way similar to the way you would normally load them. Note that you don't have to load a library or a module before using it. It will be autoloaded as soon as you reference it: