Welcome Guest, Not a member yet? Register   Sign In
How to use method setRule?

Sorry for my bad English.

Today I read Official User Guide about Validation Library. From the very beginning, the tutorial on this library has been going sequentially, but after the setRule() methods it breaks off and there is no logical conclusion just like a tutorial. I don't understand how to work the next code:

PHP Code:
Ok! I set up one rule for my form field. In tutorial wrote about it, but how to use and run the next checking? If in the condition I leave the code as in the example below, then the method setRule() has no effect. My form do not show any errors after send. What should I write in the condition if()? Another words - how to activate validation mechanism?

In my Controller I have:

PHP Code:
$validation =  \Config\Services::validation();


if (! 
            echo view('Signup', [
                'validation' => $this->validator
      echo view('Success');

and further... about 
In what cases can this method be applied? Can I have a simple example?

Thanks in advance.

Theme © iAndrew 2016 - Forum software by © MyBB