A
Anonymous
Guest
Hello,
I have the following object handling from a tutorial and I don't understand why the object is passed to another variable and then the other variable is then used as the referent? (by the way I get an error message when I do it like that)
Why is $validation used here?
I just use $validate then but it would intersting if there is something behind the construction?
Thanks, iago
I have the following object handling from a tutorial and I don't understand why the object is passed to another variable and then the other variable is then used as the referent? (by the way I get an error message when I do it like that)
Code:
if(Input::exists()) {
if(Token::check(Input::get('token'))) {
$validate = new Validate();
$validation = $validate->check($_POST,array('name'=>array(
'required' => true,
'min' => 2,
'max' => 50
)
));
if($validation->passed()) {
//update
} else {
foreach($validation->errors() as $error) {
echo $error, '<br/>';
}
}
}
Why is $validation used here?
I just use $validate then but it would intersting if there is something behind the construction?
Thanks, iago