Source of file NetefxValidatorRuleTEXTEQUALS.php
Size: 0,988 Bytes - Last Modified: 2021-12-23T10:02:33+00:00
/var/www/docs.ssmods.com/process/src/code/rules/NetefxValidatorRuleTEXTEQUALS.php
1234567891011121314151617181920212223242526272829 | <?php /** * @package NetefxValidator * @author lx-berlin * @author zauberfisch */ class NetefxValidatorRuleTEXTEQUALS extends NetefxValidatorRule { /** * Check if 2 fields are equal * @example $rule = new NetefxValidatorRuleTEXTEQUALS('Password2', 'Password', 'Password und Password2 need to match'); * @see NetefxValidatorRuleTEXTIS to check if the field is equal to a string * @param string $field name of the field * @param string $errorMsg the message to be displayed * @param string $errorMsgType the css class added to the field on validation error * @param string $otherField */ public function __construct($field, $errorMsg = null, $errorMsgType = 'error', $otherField = null) { parent::__construct($field, $errorMsg, $errorMsgType, $otherField); } /** * @param array $data * @return boolean */ public function validate($data) { return (strcmp($data[$this->field],$data[$this->args[0]])==0); } } |