Exemple #1
0
 /**
  * Displays a summary of validation errors for one or several models.
  * @param mixed $models the models whose input errors are to be displayed.
  * @param string $header a piece of HTML code that appears in front of the errors
  * @param string $footer a piece of HTML code that appears at the end of the errors
  * @param array $htmlOptions additional HTML attributes to be rendered in the container div tag.
  * @return string the error summary. Empty if no errors are found.
  */
 public function errorSummary($models, $header = null, $footer = null, $htmlOptions = array())
 {
     if (!$this->enableAjaxValidation && !$this->enableClientValidation) {
         return BSHtml::errorSummary($models, $header, $footer, $htmlOptions);
     }
     \bootstrap\helpers\BSArray::defaultValue('id', $this->id . '_es_', $htmlOptions);
     $html = BSHtml::errorSummary($models, $header, $footer, $htmlOptions);
     if ($html === '') {
         if ($header === null) {
             $header = '<p>' . Yii::t('yii', 'Please fix the following input errors:') . '</p>';
         }
         BSHtml::addCssClass(BSHtml::$errorSummaryCss, $htmlOptions);
         BSHtml::addCssStyle('display:none', $htmlOptions);
         $html = CHtml::tag('div', $htmlOptions, $header . '<ul><li>dummy</li></ul>' . $footer);
     }
     $this->summaryID = $htmlOptions['id'];
     return $html;
 }