Source of file HoneyPotField.php
Size: 0,860 Bytes - Last Modified: 2021-12-24T06:35:32+00:00
/var/www/docs.ssmods.com/process/src/code/HoneyPotField.php
123456789101112131415161718192021222324252627282930313233343536373839404142 | <?php namespace Heyday\SilverStripe\HoneyPot; use SilverStripe\Forms\TextField; /** * Class HoneyPotField * @package Heyday\SilverStripe\HoneyPot */ class HoneyPotField extends TextField { /** * @param \SilverStripe\Forms\Validator $validator * @return bool */ public function validate($validator) { if (!(is_null($this->value) || $this->value === '')) { $validator->validationError( $this->name, "This field should not be completed", "validation" ); return false; } return true; } /** * @param array $properties * @return \SilverStripe\ORM\FieldType\DBHTMLText */ public function FieldHolder($properties = array()) { return $this->renderWith('HoneyPotField_holder'); } } |