![]() |
Modular Extensions - 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 Extensions - Modules (/showthread.php?tid=6626) Pages:
1
2
|
Modular Extensions - Modules - El Forum - 03-05-2008 [eluser]wiredesignz[/eluser] Here's an example for a ME Validation Module which is totally self contained, it loads the CI Validation library, sets up the fields and rules, and maps its own class variables into the Validation Object. Code: <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); Usage: Code: modules::load('login_validation'); Modular Extensions - Modules - El Forum - 03-05-2008 [eluser]Avatar[/eluser] COOL ![]() Modular Extensions - Modules - El Forum - 03-05-2008 [eluser]badgeek[/eluser] how to get module name from a model loaded from module? ![]() thanks Modular Extensions - Modules - El Forum - 03-05-2008 [eluser]wiredesignz[/eluser] I dont recommend trying to call methods in a module from a model, it breaks the MVC design pattern. Plus this question is basic OOP theory you need to know. However, You can do this in the parent module: ![]() Code: class What_ever extends Controller And parent isn't really a good description, the module is more like the owner Modular Extensions - Modules - El Forum - 03-05-2008 [eluser]badgeek[/eluser] hmm i dont need to call module function from a model, just want to retreive the module name is that possible? Modular Extensions - Modules - El Forum - 03-05-2008 [eluser]wiredesignz[/eluser] I just showed you how to do it badgeek ![]() Modular Extensions - Modules - El Forum - 03-05-2008 [eluser]badgeek[/eluser] ahhh ok hehe thanks, Modular Extensions - Modules - El Forum - 03-09-2008 [eluser]wiredesignz[/eluser] Default Controller runs a module from the URL Code: <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); Code: $route['(.*)'] = 'default_controller'; Modular Extensions - Modules - El Forum - 03-09-2008 [eluser]wiredesignz[/eluser] The Home Module Code: <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); Modular Extensions - Modules - El Forum - 08-21-2009 [eluser]Mikle[/eluser] Does this example work with latest ME? I need to set title, meta tags and content from modules... |