Skip to content
World Wide Web Server edited this page Jul 4, 2012 · 26 revisions

[b]Current version:[/b] File:Matchbox-0.98.zip [b]Forum Thread:[/b] [url]http://codeigniter.com/forums/viewthread/65749/[/url] [b]Last update:[/b] 2009-09-02

Matchbox is a set of extended libraries that lets you organize your application in small components (modules). These modules have several advantages, the main one being portability. Modules are stored in their own folders and so they can be reused in other applications or shared between users by copying just that one folder.

[h3]Installation[/h3] If you can run CodeIgniter, you've already met the server requirements, thus all you have to do is download and unzip the latest version of Matchbox right into your application directory. File:Matchbox-0.98.zip

To test your installation, open up your browser and test the uri [b]http://yoursite.com/pathto/index.php/matchbox/[/b].

If you see the Matchbox dashboard, you've successfully installed Matchbox!

If it's not working see [b]Troubleshooting[/b] further down this page, or if that doesn't answer your questions, ask them in the [url=argh]forum thread[/url].

[h3]Usage[/h3] Installing Matchbox won't effect your current application, though. Any controllers in the [b]APPPATH/controllers/[/b] will work like they used to. To start modulizing your application you have to create a module.

[h4]Creating a module[/h4] To make a new module, you create a new folder in the [b]APPPATH/modules/[/b] directory. For instance, creating the directory [b]APPPATH/modules/my_new_module/[/b] results in a new module named 'my_new_module'.

Within this folder you place additional folders for each type of resource you need in the module. Often you'll want controllers in your module, in which case you make a 'controllers' folder in your module directory. You can also add folders for config files, helpers, languages, libraries, models, plugins and views. Your module folder should like a lot like your application directory.

[h4]Controllers in modules[/h4] So you've got a module directory with a [b]controllers/[/b] folder, and now you want to make a controller to place there. Luckily, module controllers are no different from regular controllers, so if you want to test Matchbox right away, you can go ahead and copy one of your exsisting controllers to your module (or just create a new one).

To access your controller, you go to [b]http://example.com/index.php/MODULE-NAME/CONTROLLER-NAME/[/b]. Basically the only difference from accessing a regular controller, is that you have to add the module name before the controller name in the uri. If you only type in [b]http://example.com/index.php/MODULE-NAME/[/b] and not the controller name, Matchbox will try to load the controller with the same name as the module (unless [b]strict mode[/b] is enabled).

Category:Contributions::Libraries::Miscallenous

Clone this wiki locally