fixing typo in validator documentation.

This commit is contained in:
Taylor Otwell 2011-07-15 20:02:33 -05:00
parent 48706caeb0
commit 7e15278f7d
1 changed files with 3 additions and 3 deletions

View File

@ -313,7 +313,7 @@ ### Creating Custom Validation Rules
Next, remove the **Validator** alias from **application/config/aliases.php**.
Alright! You're ready to define your own validation rule. Create a function on your new validator using a **validate_rule** naming convention:
Alright! You're ready to define your own validation rule. Create a function on your new validator using a **validate_rule** naming convention. Validator methods simply need to return **true** or **false**. It couldn't be any easier, right?
<?php
@ -326,7 +326,7 @@ ### Creating Custom Validation Rules
}
Let's dig into this example. The **validate_awesome** function receives two arguments. The first is the value of the attribute being validated, the second is an array of parameters that were specified for the rule, such as a size or list of accepted values (more on that in a second). Validator methods simply return **true** or **false**. It couldn't be any easier, right?
Let's dig into this example. The **validate_awesome** function receives two arguments. The first is the value of the attribute being validated, the second is an array of parameters that were specified for the rule, such as a size or list of accepted values (more on that in a second).
Now, how do you use your new validator? It's refreshingly simple:
@ -360,7 +360,7 @@ ### Creating Custom Validation Rules
public function validate_awesome($attribute, $parameters)
{
return $attribute = $parameters[0];
return $attribute == $parameters[0];
}
}