OSB enhancements to date
This commit is contained in:
29
application/classes/validate.php
Normal file
29
application/classes/validate.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* Array and variable validation.
|
||||
*
|
||||
* @package OSB/Modifications
|
||||
* @category Classes
|
||||
* @author Deon George
|
||||
* @copyright (c) 2010 Deon George
|
||||
* @license http://dev.leenooks.net/license.html
|
||||
*/
|
||||
class Validate extends Kohana_Validate {
|
||||
/**
|
||||
* Checks if a field matches the value of another field, if it is set.
|
||||
* Field is ignored if it is blank.
|
||||
*
|
||||
* This function is only invoked anyway when the value is set as per
|
||||
* $this->_empty_rules
|
||||
*
|
||||
* @param string field value
|
||||
* @param string field name to match
|
||||
* @return boolean
|
||||
*/
|
||||
protected function matches_ifset($value, $match)
|
||||
{
|
||||
return ($value === $this[$match]);
|
||||
}
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user