[solved]Custom Validation? |
[eluser]Mirge[/eluser]
[quote author="brucebat" date="1312331674"]Correct My function is within the Controller class. The example uses the $str as an argument, Code: function username_check($str) Post the entire controller please. And yes, $str is fine. You could call it $someStupidLongVariableNameThatIProbablyShouldNotUse if you wanted.
[eluser]brucebat[/eluser]
Too big for the forum so here is Pastebin Link http://pastebin.com/axRVAB8u Thanks
[eluser]Mirge[/eluser]
Put something like: echo 'got here - inside for loop'; immediately after the opening brace of the for loop.. make sure it's even getting in there. EDIT: I don't see a constructor. And is form_validation library auto-loaded?
[eluser]brucebat[/eluser]
Code: echo "hello".$i; Okay tried that and it is working: So if the user completes three rows I get: Quote:hello0
[eluser]brucebat[/eluser]
form_validaiton is autoloaded. Would a constructor be necessary? From my understanding of constructors in C++ they are used to create class attributes and set values? But in my class there are no attributes being shared in the class? Thanks
[eluser]Mirge[/eluser]
Not sure if they're required or not... I do know you have to call parent::__construct() if you have a constructor. Not sure if the base class constructor gets called automatically or not. I'd add a constructor & see if it does anything. If not, was only a few seconds lost.
[eluser]brucebat[/eluser]
Ok I placed a constructor in the class, should I put anything inside it? So far its not done anything Hmmm
[eluser]Mirge[/eluser]
Code: public function __construct() Very strange issue, if that doesn't work. I'll have to look at code again.
[eluser]brucebat[/eluser]
DOH!!! I am so silly, I was calling the error reporting before the form_validation was being run. Okay so the form_validation works and the function is getting called as the "hello world" echo i put it in it is being displayed however it is not giving an error message. |
Welcome Guest, Not a member yet? Register Sign In |