Source of file NetefxValidatorRuleTEXTCONTAINS.php
Size: 0,899 Bytes - Last Modified: 2021-12-23T10:02:33+00:00
/var/www/docs.ssmods.com/process/src/code/rules/NetefxValidatorRuleTEXTCONTAINS.php
12345678910111213141516171819202122232425262728 | <?php /** * @package NetefxValidator * @author lx-berlin * @author zauberfisch */ class NetefxValidatorRuleTEXTCONTAINS extends NetefxValidatorRule { /** * Check if the field contains a string * @example $rule = new NetefxValidatorRuleTEXTCONTAINS('Company', 'Company must contain "Netefx"', null, 'Netefx'); * @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 $needle */ public function __construct($field, $errorMsg = null, $errorMsgType = 'error', $needle = null) { parent::__construct($field, $errorMsg, $errorMsgType, $needle); } /** * @param array $data * @return boolean */ public function validate($data) { return (strpos($data[$this->field],$this->args[0]) !== false); } } |