initial commit of validation classes.
This commit is contained in:
25
system/validation/rules/confirmation_of.php
Normal file
25
system/validation/rules/confirmation_of.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php namespace System\Validation\Rules;
|
||||
|
||||
use System\Input;
|
||||
use System\Validation\Rule;
|
||||
|
||||
class Confirmation_Of extends Rule {
|
||||
|
||||
/**
|
||||
* Evaluate the validity of an attribute.
|
||||
*
|
||||
* @param string $attribute
|
||||
* @param array $attributes
|
||||
* @return void
|
||||
*/
|
||||
public function check($attribute, $attributes)
|
||||
{
|
||||
if ( ! array_key_exists($attribute, $attributes))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return Input::has($attribute.'_confirmation') and $attributes[$attribute] === Input::get($attribute.'_confirmation');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user