![]() |
Modular Extensions - (HMVC) - Version 3.1.9 - 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 - (HMVC) - Version 3.1.9 (/showthread.php?tid=6385) |
Modular Extensions - (HMVC) - Version 3.1.9 - El Forum - 03-03-2008 [eluser]sikkle[/eluser] so with that what will i call in my "standard" view to call this module ? thanks a lot for your time really. Modular Extensions - (HMVC) - Version 3.1.9 - El Forum - 03-03-2008 [eluser]wiredesignz[/eluser] from your view: Code: <?php echo modules::run('find_last10') ?> Modular Extensions - (HMVC) - Version 3.1.9 - El Forum - 03-03-2008 [eluser]Avatar[/eluser] wiredesignz, thank you for this great library addition to ci. I have been trying it out and in my test I have found that I had to modify the run function call. Please see below. Code: function run($module, $data = '', $method = 'index') Does the ci community think that would be a worth while addition to this library? I have some other addition I will submit later, just slipped my mind at the moment. I will do more testing. Thank you. Modular Extensions - (HMVC) - Version 3.1.9 - El Forum - 03-03-2008 [eluser]Avatar[/eluser] Actually the above still doesn't fix this bug. Will do more testing. Is there any way for me to find out which is the current active module that code is running in? Basically, what is the active module? Modular Extensions - (HMVC) - Version 3.1.9 - El Forum - 03-03-2008 [eluser]wiredesignz[/eluser] Every module is created with an index method, so your alteration is not required. Code: class Module I don't understand why you need to see which module is running but you can use: get_class($this) inside the module to get its class name. Modular Extensions - (HMVC) - Version 3.1.9 - El Forum - 03-03-2008 [eluser]Avatar[/eluser] yes, I understand. I combining this library with smarty and in my project I can't think of any other way but to call module functions. But for that to work there needs to be validation that that function exists in the module instead of spitting out an error call index function. when running this function, I get the error below. FUNCTION: Code: function run($module, $data = '', $method = 'index') Code: A PHP Error was encountered and if with previous code function_exists($class->$method($data)) it just calls index, disregarding the function call altogether, kinda. Need professional assistance ![]() Modular Extensions - (HMVC) - Version 3.1.9 - El Forum - 03-03-2008 [eluser]wiredesignz[/eluser] Try this: Code: function run($module, $data = '', $method ='index') Modular Extensions - (HMVC) - Version 3.1.9 - El Forum - 03-03-2008 [eluser]Avatar[/eluser] Thank you for fast reply. But it's still doing it, same error. Modular Extensions - (HMVC) - Version 3.1.9 - El Forum - 03-03-2008 [eluser]Avatar[/eluser] something inside function_exists with the $method it doesn't like Modular Extensions - (HMVC) - Version 3.1.9 - El Forum - 03-03-2008 [eluser]wiredesignz[/eluser] Check the edit above ![]() use method_exists($class, $method) I will add this to the helper in 4.0.3 Thanks ![]() |