CI 1.7.0 Form_Validation rules/callback function possible bug |
[eluser]i_am_using_ci[/eluser]
Hi, I Have controller with couple of functions, Code: <?php The problem is: When I set: Code: <?php without checking template_id, everything was working normally, after adding template_id rule (and making $rules multidimensional array) everything came broken, $ids now string, not array, maybe I mistaked somewhere? I've re-checked 3 times, so please help
[eluser]pistolPete[/eluser]
Your constructors aren't correct, they need to be changed to: Code: <?php Set your rules to required as well: Code: $rules = array( How are your html input-fields named? Does the callback function _template_exists() exist?
[eluser]i_am_using_ci[/eluser]
My controller __constuct() method is correct, I am using php5 way, and it works, so don't worry. I show just a part of my controller, _template_exists() method exists, my input fields named: 'to_delete[]' and 'template_id' as you can see. One more example for avoiding any similar questions: Code: function delete() { I am getting result: Code: Before $this->form_validation->run():
[eluser]TheFuzzy0ne[/eluser]
[quote author="i_am_using_ci" date="1234728704"]My controller __constuct() method is correct, I am using php5 way, and it works, so don't worry.[/quote] No, your constructor method is incorrect, and it doesn't work... Try putting a call to log_message() in there, or an echo statement. I promise you it won't be called. The "PHP5 way" is to use the __construct() method. If you can sort out the obvious problem first, someone might be happy to help you further.
[eluser]i_am_using_ci[/eluser]
Oh, sorry, my fault, I wasn't checking my source this way, of course parent::__construct(), It's just a typo mistake. Please help with the main problem
[eluser]TheFuzzy0ne[/eluser]
This is not a bug. Please repost in the [url="http://ellislab.com/forums/viewforum/53/"]Code and Application Development[/url] forums, where there will be more people looking to help other users.
[eluser]i_am_using_ci[/eluser]
Nice explanation, btw would you like to share your opinion why it's not a bug and how can I validate my form correctly?
[eluser]i_am_using_ci[/eluser]
Got code working, it's not a bug, details: http://ellislab.com/forums/viewthread/105965/ |
Welcome Guest, Not a member yet? Register Sign In |