HMVC issue - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: External Resources (https://forum.codeigniter.com/forumdisplay.php?fid=7) +--- Forum: Addins (https://forum.codeigniter.com/forumdisplay.php?fid=13) +--- Thread: HMVC issue (/showthread.php?tid=63360) |
HMVC issue - Sentro - 10-22-2015 Hello, I've been using Codeigniter for a while now and i want to introduce modules to my app. I've downloaded wiredesignz latest extension ( supposed to support CI 3.x ) and i've been having trouble getting it to work. I setup a controller named "Home" in my application/controllers folder. Code: <?php Created a module with the below structure And this is the modules controller class Test Code: <?php When i run the URL in the browser all i get is the below "ok here we go " which is outputted by the Home controller. What am i doing wrong ? RE: HMVC issue - davicotico - 10-22-2015 Your class Test should extend MX_Controller: PHP Code: class Test extends MX_Controller{ RE: HMVC issue - Sentro - 10-22-2015 (10-22-2015, 11:16 AM)davicotico Wrote: Your class Test should extend MX_Controller: Changed that and still now luck. If i try Code: $this->load->module('test'); Code: Message: Call to a member function sayhello() on a non-object Now just to clarify the controller i'm trying to call the modules controller is located in "applications/controllers" not in another modules controllers. RE: HMVC issue - Martin7483 - 10-22-2015 Hi! Maybe you can take a look at my approach of HMVC in CodeIgniter http://forum.codeigniter.com/thread-63078.html RE: HMVC issue - Sentro - 10-23-2015 (10-22-2015, 03:45 PM)Martin7483 Wrote: Hi! Hello, I downloaded your application and any ideas why i might be getting Code: Message: Call to undefined function set_realpath() Codeigniter version is 3.0.02 RE: HMVC issue - Martin7483 - 10-23-2015 (10-23-2015, 12:43 AM)Sentro Wrote:(10-22-2015, 03:45 PM)Martin7483 Wrote: Hi! Sorry about that. You need to load the path helper. I auto load it in my auto load config file and recommend you do this when using the Simple HMVC PHP Code: $this->load->helper('path'); RE: HMVC issue - Sentro - 10-23-2015 (10-23-2015, 12:54 AM)Martin7483 Wrote:(10-23-2015, 12:43 AM)Sentro Wrote:(10-22-2015, 03:45 PM)Martin7483 Wrote: Hi! Thank you, works like a charm. Actually there is also another function in system/helpers/path_helper I'll get right into since i need something like it ASAP. Thank you for this. RE: HMVC issue - Martin7483 - 10-23-2015 (10-23-2015, 01:03 AM)Sentro Wrote: Thank you, works like a charm. Actually there is also another function in system/helpers/path_helper Yes, that is the original CI set_realpath. Only the original throws an error when a file or directory does not exist. I wanted it to return FALSE when testing failed. Hope it will help you out. Any improvements or suggestions or most welcome |