![]() |
Modular Separation - PHP5 (Modules) - 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: Modular Separation - PHP5 (Modules) (/showthread.php?tid=20208) |
Modular Separation - PHP5 (Modules) - El Forum - 11-15-2009 [eluser]wiredesignz[/eluser] Modular Separation - PHP5 version 1.09 is attached to this post. Added $route['404'] routing to enable using a custom "Page not found" controller. Thanks Phil Sturgeon ![]() EDIT: deprecated file removed Modular Separation - PHP5 (Modules) - El Forum - 11-20-2009 [eluser]johnwbaxter[/eluser] This is sexy, i'm gonna start using this now. Nice action wiredesignz, thanks very much. Modular Separation - PHP5 (Modules) - El Forum - 11-24-2009 [eluser]AgentPhoenix[/eluser] I ported one of my projects from Modular Extensions to Modular Separation because is more in line with what I was looking. Love it so far, but I've run in to one small issue and after looking through the code couldn't find an obvious way to do it. I have a template that pulls files in dynamically, but when I use the first segment of the URI, it's my controller, not my module. How do I find out the current module I'm executing from? Modular Separation - PHP5 (Modules) - El Forum - 11-24-2009 [eluser]wiredesignz[/eluser] [quote author="AgentPhoenix" date="1259109351"]...How do I find out the current module I'm executing from?[/quote] Code: $this->router->fetch_module(); Modular Separation - PHP5 (Modules) - El Forum - 11-24-2009 [eluser]AgentPhoenix[/eluser] Ugh. So simple. I feel stupid. Thanks, wired! Modular Separation - PHP5 (Modules) - El Forum - 11-25-2009 [eluser]codex[/eluser] [quote author="wiredesignz" date="1258003082"]Yes modules may contain a config/routes.php file. The main difference from application routes, is that you set a default controller for a module like so: Code: $route['module'] = 'controller'; So, in application > config > routes.php there's Code: $route['default_controller'] = "welcome"; and in modules > welcome > config > routes.php there's Code: $route['welcome'] = "welcome"; // is this correct? When you go to /test you get a 404. What am I missing here? EDIT: if you put the name of the controller before /test (welcome/test) then it works. Is this how it should work? Modular Separation - PHP5 (Modules) - El Forum - 11-25-2009 [eluser]wiredesignz[/eluser] [quote author="codex" date="1259181151"]... Is this how it should work?[/quote] Code: $route['incoming/route(.*)'] = 'controller/method$1'; Very simple. Modular Separation - PHP5 (Modules) - El Forum - 11-25-2009 [eluser]M4rc0[/eluser] Can anybody provide me a file structure example of Modular Separation in use ? When should you use "modules" ? I know that if you want to have an admin interface this might be useful, but what else? Sorry to ask this, it's just didn't find any documentation about it. Thanks in advance! EDIT: Hmmm, just saw your signature about Modular Extensions. That helped understanding! So by using those attached files I can have modular separation without the need of a lib/plugin for it? Modular Separation - PHP5 (Modules) - El Forum - 11-27-2009 [eluser]dinhtrung[/eluser] Hi, I'm building a modular administration portal for my company. I really like the way Wordpress construct their Library for Image, Videos, Documents and Musics. Is there anyway to build a "shared" modules, which will provide utilities for other modules in the system? Anyone done this task before? I want to learn how did you do it. Please, I'm in short of time for my project... If the module can provide another tab inside the form of other module, then that would be great. For example, something like "Comment Configuration", with 2 options : "Enable Comments" or "Disable Comments". Then this module could be use for "Articles", "Pages" and "Categories" modules : the same view, the same field. Any suggestion??? Modular Separation - PHP5 (Modules) - El Forum - 11-27-2009 [eluser]dinhtrung[/eluser] Quote:...How do I find out the current module I’m executing from?More over, you can find out the current module, controllers, methods, and uniqueid of the object you're interact with this: Code: $this->module = $this->router->fetch_module(); |