Modular Extensions - HMVC version 5.4 - 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 5.4 (/showthread.php?tid=38057) |
Modular Extensions - HMVC version 5.4 - El Forum - 01-25-2012 [eluser]ericrjones1[/eluser] :red: Fail. You are right. I didn't notice that you had set the visibility to public. Modular Extensions - HMVC version 5.4 - El Forum - 01-26-2012 [eluser]ericrjones1[/eluser] @wiredesignz: Being the smug developer that I am, I followed your solution provided with one exception. I used the following: Code: $this->form_validation->CI = $this; Based upon my PHP version information, I would have assumed that $this would be passed by reference since $this is referring to my controller ( an object - in PHP 5 all objects are passed by reference automatically, right? ). Code: $ php -v However, when using the form_validation_helper function validation_errors the conditional statement on line 1054 says that the $CI->form_validation object isn't set even though the $CI->load->is_loaded('form_validation') returns 'form_validation'; Dumping the $CI object, I can see the following loaded classes, but no form_validation object. Code: protected '_ci_classes' => & So the gist is: Code: // Doesn't work ( mine ) I feel like I am totally missing something. If you can, will you please explain to me why my code doesn't work. Thanks for all your help. Modular Extensions - HMVC version 5.4 - El Forum - 01-27-2012 [eluser]PhilTem[/eluser] It won't be passed by reference as long as you use = since = is an assign-operator nothing more. = doesn't create a pointer but creates a copy. Other than get_instance() does, since this returns a static variable (have a look at the code). So you really need to do Code: $this->form_valdiation->CI =& $this; to assign it by reference rather than pass by reference (pass by reference basically only works for functions, not assignments ) The & is the reference symbol. Modular Extensions - HMVC version 5.4 - El Forum - 02-03-2012 [eluser]Philo01[/eluser] Hi WireDesignz, I was wondering if you know why the following code is returning "GO" on the main controller, but returns "FAIL" for each module loaded via modules::run inside the views? third_party/MX/Loader.php Code: class MX_Controller Thanks! Modular Extensions - HMVC version 5.4 - El Forum - 02-07-2012 [eluser]osci[/eluser] I was trying to make a module for db backup using dbutil. When in MX controller Code: $db1 = $this->load->database($db_group,TRUE); When I do $this->load->dbutil() in mysql_utility.php in dbutil() $CI =& get_instance(); gives me the db which was autoloaded (from autoload) Any ideas? Modular Extensions - HMVC version 5.4 - El Forum - 02-07-2012 [eluser]wiredesignz[/eluser] @osci, Try this: Code: $db1 = $this->load->database($db_group, TRUE); Modular Extensions - HMVC version 5.4 - El Forum - 02-07-2012 [eluser]osci[/eluser] This correctly sets the db to the desired one. Thx for the tip. I also tried Code: $db1 = $this->load->database($db_group) Code: if ($return === TRUE) return DB($params, $active_record); Modular Extensions - HMVC version 5.4 - El Forum - 02-07-2012 [eluser]wiredesignz[/eluser] Once a database group is loaded it cannot be changed to another group by calling $this->load->database($db_group) again. This is part of the CI logic in the database loader method. Code: if (class_exists('CI_DB') AND $return == FALSE AND $active_record == NULL AND isset($CI->db) AND is_object($CI->db)) Modular Extensions - HMVC version 5.4 - El Forum - 02-11-2012 [eluser]Philo01[/eluser] Hi wiredesignz, Is it correct that loading modules in views does not work if modules controllers contain the same file / class name? I have the following routes active and are the reason why controllers share the same name in each module: Code: $route['(\w{2})/cms/([a-zA-Z_-]+)/(:any)'] = '$2/back_end/$3'; File structure application/modules: /slider/controllers/slider.php /slider/controllers/back_end.php /products/controllers/products.php /products/controllers/back_end.php Now this will fail (returns nothing): Code: <?php echo modules::run('slider/back_end/somemethod'); ?> If I move the method to the unique named slider controller and try: Code: <?php echo modules::run('slider/slider/somemethod'); ?> Code: <?php echo modules::run('slider/somemethod'); ?> It works fine. Do you know how to solve this? Thanks! Modular Extensions - HMVC version 5.4 - El Forum - 02-21-2012 [eluser]Dan Tdr[/eluser] hey wiredesignz, i kind of bumped into a problem, i am using MX in building a kind of economic application, but i want to be able to let other programmers to develop other modules(plugins) to extend the core modules. for example: i have the "clients" module that has 3 tabs with informations, and with a module(plugin) i want to add a 4th tab (jquery tabs) how can i do that? in theory i have the core functionality and view, and i have to somehow extend them to add another tab and functionality for that tab. Code: <div id="tabs"> here is a sample of my view file. |