Wick is a simple library that provides a method for loading and rendering one controller from within another controller. Some call it HMVC, some yell witchcraft and hunt you down with a pitchfork.
The library is ridiculously simple, and haven’t been tested fully. Please try it out and tell me if it works (and more importantly, if it doesn’t).
The library can be downloaded here.
---
Installation
Installation is easy as pie: Unzip the package and upload the Wick.php file to your application/libraries folder.
Note: If you are running multiple applications from the same CodeIgniter installation which all use the library you may wish to upload the file to the system/libraries folder instead.
Aaand you’re done!
Initialization
First of all you will have to load the library. You can either load it manually in your controller constructor or choose to auto-load it instead.
To initialize the class manually in your controller constructor, use the $this->load->library function:
$this->load->library('Wick');
Once loaded, the controller loader will be available using: $this->wick->light
Usage
The first (and only) parameter is the segments that lead to the controller and method you wish to call. Segments can be a string or an array.
$this->wick->light('news/local/123');
This will call the requested controller and show any output it migth give, before continuing execution of your current controller.
---
