/**
  * Override Wire's error method and place errors in the context of their inputfield
  * 
  * @param string $text
  * @param int $flags
  * @return mixed
  *
  */
 public function error($text, $flags = 0)
 {
     $key = $this->getErrorSessionKey();
     $errors = $this->session->{$key};
     if (!is_array($errors)) {
         $errors = array();
     }
     if (!in_array($text, $errors)) {
         $errors[] = $text;
         $this->session->set($key, $errors);
     }
     $text .= $this->name ? " ({$this->name})" : "";
     return parent::error($text, $flags);
 }
Example #2
0
 /**
  * Override Wire's error method and place errors in the context of their inputfield
  *
  */
 public function error($text)
 {
     $key = $this->getErrorSessionKey();
     $errors = $this->session->{$key};
     if (!is_array($errors)) {
         $errors = array();
     }
     $errors[] = $text;
     $this->session->set($key, $errors);
     return parent::error($text . " ({$this->name})");
 }
Example #3
0
 public function error($text, $flags = 0)
 {
     $runner = $this->getRunner();
     if ($runner) {
         $runner->error($text, $flags);
     } else {
         parent::error($text, $flags);
     }
     return $this;
 }