Example #1
0
 function validate($v)
 {
     if (($v = strtotime($v)) === false) {
         throw new ValidationException('Could not convert string to a date, please use MM/DD/YYYY. Your value');
     }
     return parent::validate();
 }
 /**
  *
  */
 public function signoff($content = true)
 {
     if ($content === true) {
         $content = date('Y-m-d');
     }
     $this->title = new HTMLAttribute($content);
     // we have no use for $this->value() in this context
     parent::value($content);
     $this->disabled = true;
 }
 public function __toString()
 {
     $html = trim(parent::__toString());
     if ($this->readonly) {
         $html = nl2br($html);
     } else {
         $html .= $this->value() . '</' . $this->tag_name . '>';
     }
     return $html;
 }
 public function validate($v)
 {
     if ($v == '') {
         return;
     }
     $v = filter_var($v, FILTER_VALIDATE_EMAIL);
     if ($v === false) {
         throw new ValidationException('That is not a valid email address');
     }
     return parent::validate();
 }