Modular Extensions - Version 4.3 - 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 - Version 4.3 (/showthread.php?tid=6550) |
Modular Extensions - Version 4.3 - El Forum - 03-20-2008 [eluser]dfau[/eluser] I have this controller (non ME): Code: <?php Code: <h2>Validation errors</h2> Quote:Undefined property: Loader::$validationUnder 4.0.21 $this->validation appears "clean" ie. it doesn't hold over (say) $this->validation->error_string. Any ideas? Modular Extensions - Version 4.3 - El Forum - 03-20-2008 [eluser]gerben[/eluser] Wiredezignz, that did the trick! Thanx a lot! Modular Extensions - Version 4.3 - El Forum - 03-20-2008 [eluser]wiredesignz[/eluser] @dfau, 4.0.19 was not assigning libraries to the module correctly. Which is why we continue to develop ME. You should not really call libraries directly from a view, because it makes the view dependent on the library. I recommend passing a reference to the object into the view, or extracting the $data from the library first. Code: $this->load->view('login', array('errors' => $this->validation->error_string)) In any case I will try to duplicate your code to see if there is an issue. Modular Extensions - Version 4.3 - El Forum - 03-20-2008 [eluser]wiredesignz[/eluser] [quote author="gerben" date="1206081372"]Wiredezignz, that did the trick! Thanx a lot![/quote] You're welcome gerben, I will update the wiki to Version 4.0.22 soon. Modular Extensions - Version 4.3 - El Forum - 03-20-2008 [eluser]wiredesignz[/eluser] @dfau, this works fine for me. v4.0.21 Code: //module Modular Extensions - Version 4.3 - El Forum - 03-20-2008 [eluser]wiredesignz[/eluser] Version 4.0.22 is available on the wiki. Updated modules file loader. Thanks gerben Modular Extensions - Version 4.3 - El Forum - 03-20-2008 [eluser]marios[/eluser] [quote author="wiredesignz" date="1206082883"]@dfau, this works fine for me. v4.0.21 Code: //module I can't get that to work that way. I am using version 4.0.22 the only way i get no error is if i use the $_me reference like this : $this->_me->validation->error_string in the view. here is my code sample: for the module: Code: <?php and for the view: Code: <div id="submit"> Modular Extensions - Version 4.3 - El Forum - 03-20-2008 [eluser]dfau[/eluser] Hi wiredesignz, I'm still having trouble getting system libraries to work properly from view. The validation library is good to use from the view as it saves a lot of work in the controller for setting up error responses. I've not been using CI for long and am learning as I go. In your library loading function you load the system libraries around line 238: Code: if (is_file(BASEPATH.'libraries/'.$library.EXT) OR is_file(APPPATH.'libraries/'.$library.EXT)) and then call the constructor for the same library and assign to _me around line 345: Code: $this->_me->$_library =& new $library($params); As a hack, if I replace the second constructor call with: Code: $ci =& get_instance(); Could you please have a double check to see exactly what the behaviour should be? I'm happy to do any testing required. Many thanks, dfau Modular Extensions - Version 4.3 - El Forum - 03-20-2008 [eluser]wiredesignz[/eluser] Version 4.0.23 is available on the wiki Corrected an issue with the CI library loader, Thanks marios and dfau. There is an issue with the download version of CI where load_class() causes an error due to the CI loader using `include` instead of `include_once`, I have had to adapt my code to compensate for this. Thus there were two instances of CI libraries being loaded as you mention. I have corrected this in 4.0.23. Derek Allard has kindly altered CI recently to fix this, so the latest SVN version library loader now uses include_once. Please note: $this->load->module->anything() is deprecated, just use $this->load->anything(). Thanks Modular Extensions - Version 4.3 - El Forum - 03-20-2008 [eluser]dfau[/eluser] Thanks wiredesignz, will give it a play. EDIT: All good wiredesignz, thanks again for your time. |