Wick

Derek Jones edited this page Jul 5, 2012 · 13 revisions
Clone this wiki locally

Wick is a library for CodeIgniter. It 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. Either way, it's free and released under the LGPL.

Download latest version of Wick

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 might give, before continuing execution of your current controller.

Category:Contributions::Libraries::Miscallenous