本文整理匯總了PHP中WireData::error方法的典型用法代碼示例。如果您正苦於以下問題:PHP WireData::error方法的具體用法?PHP WireData::error怎麽用?PHP WireData::error使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WireData
的用法示例。
在下文中一共展示了WireData::error方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: error
/**
* 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);
}
示例2: error
/**
* 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})");
}
示例3: error
public function error($text, $flags = 0)
{
$runner = $this->getRunner();
if ($runner) {
$runner->error($text, $flags);
} else {
parent::error($text, $flags);
}
return $this;
}