Matchbox Helper - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: Matchbox Helper (/showthread.php?tid=9232) |
Matchbox Helper - El Forum - 06-17-2008 [eluser]Phil Sturgeon[/eluser] Have been working on doing some more interesting things with Matchbox than the usual sort of thing. Making things truely modular and dynamic (even routes) and while I was doing it I realized we should be able to do more checks to see if modules exist and controllers are about. Havent worked on this for a massive amount of time so it may not be ideal, but its a kick in the right direction. Give it a try: matchbox_helper.php Code: <?php if (!defined('BASEPATH')) exit('No direct script access allowed.'); Matchbox Helper - El Forum - 06-17-2008 [eluser]TheLoops[/eluser] Please excuse my ignorance :red: How (and when/for what) would I use this? Matchbox Helper - El Forum - 06-18-2008 [eluser]Phil Sturgeon[/eluser] A fair question. Depends how modular you want your system to be. For example, I have navigation that cycles through all modules and picks out only modules that have a controller named 'admin'. This lets me build my admin navigation built PURELY from dropping a module in. I have something similar on the frontend for user navigation and sitemap. I also use is_module() to check a module exists before trying to run content based on that module being there. On my CMS I have a products module which relies on suppliers. If suppliers is not there, it wont bother asking about them. It allows everything to run alot more dynamically if you are managing several sites with the same cms. I can at the moment give a client a site with custom content by asking which modules they want, dropping them all on their site and changing the database settings alone. Handy for me ^_^ Matchbox Helper - El Forum - 06-18-2008 [eluser]TheLoops[/eluser] Ah, ok that makes sense, thanks. Not yet sure if I'll go with it though Matchbox Helper - El Forum - 06-18-2008 [eluser]Phil Sturgeon[/eluser] Hah thats up to you of course. I made plenty of sites without ever needing this, its probably only for a select few. I just dont like keeping handy things to myself, if 2 other CI users ever use this then the post was worth it. |