Modular Extensions - Version 4.3 |
[eluser]wiredesignz[/eluser]
Thanks, I'll add this change to version 4.0.27
[eluser]Daeli[/eluser]
Is there a chance to use callback function in validation rules?
[eluser]wiredesignz[/eluser]
Yes you can use my Validation callbacks into Models extension, it also works with Modules. Good Luck. http://codeigniter.com/wiki/MY_Validatio...to_Models/
[eluser]Daeli[/eluser]
[quote author="wiredesignz" date="1208447034"]Yes you can use my Validation callbacks into Models extension, it also works with Modules. Good Luck. http://codeigniter.com/wiki/MY_Validatio...to_Models/[/quote] There is a bug in MY_Validation library when you use Modular Extensions On line 127: Code: if (!method_exists($this->CI->$class, $method)) The loaded Models are only stored in the Module wich loaded it...
[eluser]wiredesignz[/eluser]
Yes thats right, the callback would need to be into the Module Controller, not the Module Model. However that extension could easily be modified to use a Module Model. I'll look into that at some stage. Thanks.
[eluser]wiredesignz[/eluser]
I have posted an advanced version of the callbacks into models extension to the wiki. Just for you Daeli. You must pass the calling object to the Validation class ie: $this->validation->run($this); This will make Module Models visible to Validation.
[eluser]tomcode[/eluser]
Hopefully I've found now the right thread, sorry having moved up the old one. I've now successfully converted my app to fit into modular extensions. What a relief to have well ranged functionality. Thanks for this smart, small yet powerful tool. My question: Is there a way to declare application-wide (cross -module) variables ? Since now I worked with a file 'libraries/MY_Controller.php' which was loaded automatically. I then extended my controllers not to the Controller class but to the Commons class. Thus I had a set of base data (and functions) everywhere available. But now this seems no longer possible. MY_Controller is no longer loaded, and even when I put the functionality into the Default_controller, the module controllers ignore whatever happens in the Default_controller. Code: libraries/MY_Controller.php:
[eluser]wiredesignz[/eluser]
Class definitions must be so, otherwise it will not load automatically: Code: //MY_Controller class Any other definition for a base controller must be a include: Code: //Commons class
[eluser]tomcode[/eluser]
small bug notice (if not already changed): use of .php instead of constant .EXT file modules_helper.php * @version: 4.0.26 © Wiredesignz 2008-03-25 line 24 is : Code: require_once APPPATH.'libraries/modular_extensions.php'; should be : Code: require_once APPPATH.'libraries/modular_extensions' .EXT; |
Welcome Guest, Not a member yet? Register Sign In |