示例#1
0
 /**
  * Renders validator errors of filter model.
  * @return string the rendering result.
  */
 public function renderErrors()
 {
     if ($this->filterModel instanceof Model && $this->filterModel->hasErrors()) {
         return Html::errorSummary($this->filterModel, $this->filterErrorSummaryOptions);
     } else {
         return '';
     }
 }
示例#2
0
 /**
  * Generates a summary of the validation errors.
  * If there is no validation error, an empty error summary markup will still be generated, but it will be hidden.
  * @param Model|Model[] $models the model(s) associated with this form
  * @param array $options the tag options in terms of name-value pairs. The following options are specially handled:
  *
  * - header: string, the header HTML for the error summary. If not set, a default prompt string will be used.
  * - footer: string, the footer HTML for the error summary.
  *
  * The rest of the options will be rendered as the attributes of the container tag. The values will
  * be HTML-encoded using [[\Leaps\Helper\Html::encode()]]. If a value is null, the corresponding attribute will not be rendered.
  * @return string the generated error summary
  * @see errorSummaryCssClass
  */
 public function errorSummary($models, $options = [])
 {
     Html::addCssClass($options, $this->errorSummaryCssClass);
     $options['encode'] = $this->encodeErrorSummary;
     return Html::errorSummary($models, $options);
 }