HMVC and form_validation.php? |
[eluser]PhilTem[/eluser]
Hm... for the files you sent me I can say, that the controller 'test/test' doesn't extend the MY_Controller class but rather the MX_Controller class. I don't know about the files that originally made problems, but it may be the same typo? MX and MY look pretty similar when reading quickly PS: It took me 15min. to find that problem. What I did: Loaded the form-validation in the controller's __construct() and assigned $this to form_validation->CI in the same __construct().
[eluser]Steve Goodwin[/eluser]
Hi Phil, Yeah I threw that together as quickly as i could to give you some idea of what i was trying to do. Has that worked for you and does the validation work now? I've tried based on my interpretation of what you've said and its still not working by putting this in the controllers constructor: Code: class Test extends MX_Controller { Thanks for your time on this, i'm stuck and have alot to do by the end of the week and a day spent on this problem is really annoying me lol.
[eluser]Steve Goodwin[/eluser]
I managed to sort this by removing the form_validation from the autoload file. Thanks for your time on this much appreciated! Can i buy you a drink for your help?
[eluser]PhilTem[/eluser]
Well, no, I actually did a little more than that, but I could now nail it down where it all starts. But I don't know yet, why it doesn't work: In MY_Form_validation you call the parent's construct() method. If you comment everything in your MY_Form_validation class except the public $CI part it will work. And you don't even need to pass a validation-group (which, btw, must not have the module's name in the key, it will work with controller/method).
[eluser]PhilTem[/eluser]
And I found the problem Your code: Code: class MY_Form_validation extends CI_Form_Validation { (Important) Code in CI_Form_validation Code: class extends CI_Form_Validation { See the difference? Change your code to Code: class MY_Form_validation extends CI_Form_Validation { and it should work
[eluser]Steve Goodwin[/eluser]
I've followed those instructions and it still doesn't work =[ Perhaps you can package the code back up and send it back over? I'll take a ganders at it and see whats going wrong. I opened up my validation test code locally and change the following: My_Form_validation.php Code: class MY_Form_validation extends CI_Form_Validation { Test.php (controller) Code: class Test extends MX_Controller { Thanks for your help, this is quite a frustrating problem! lol
[eluser]PhilTem[/eluser]
There was another fix I did (forgot it would have such an impact): Remove the library from autoload.php Additionally, you can have your altered code here http://files.ignitedco.de/codeigniter/te..._FIXED.zip
[eluser]Steve Goodwin[/eluser]
thanks can I send you a few drinks for your efforts?
[eluser]Steve Goodwin[/eluser]
PM me your details and i'll send a couple your way, thanks for your help. Code: if($people_help) |
Welcome Guest, Not a member yet? Register Sign In |