Пример #1
0
 public function errorSummary($models, $header = NULL, $footer = NULL, $htmlOptions = array())
 {
     $header = '<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>';
     $footer = '';
     $htmlOptions = array_merge(array('class' => 'alert alert-danger'), $htmlOptions);
     return parent::errorSummary($models, $header, $footer, $htmlOptions);
 }
Пример #2
0
 /**
  *### .errorSummary()
  *
  * Displays a summary of validation errors for one or several models.
  *
  * This method is very similar to {@link CHtml::errorSummary} except that it also works
  * when AJAX validation is performed.
  *
  * @param mixed $models the models whose input errors are to be displayed. This can be either
  * a single model or an array of models.
  * @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.
  *
  * @see CHtml::errorSummary
  */
 public function errorSummary($models, $header = null, $footer = null, $htmlOptions = array())
 {
     if (!isset($htmlOptions['class'])) {
         $htmlOptions['class'] = 'alert alert-block alert-error';
     }
     // Bootstrap error class as default
     return parent::errorSummary($models, $header, $footer, $htmlOptions);
 }
Пример #3
0
 /**
  * Displays a summary of validation errors for one or several models.
  *
  * This method is a wrapper for {@link \CActiveForm::errorSummary}.
  *
  * @param mixed $models The models whose input errors are to be displayed. This can be either a single model or an array of models.
  * @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.
  * @see \CActiveForm::errorSummary
  */
 public function errorSummary($models, $header = null, $footer = null, $htmlOptions = [])
 {
     if (!isset($htmlOptions['class'])) {
         $htmlOptions['class'] = 'alert alert-block alert-error';
     }
     return parent::errorSummary($models, $header, $footer, $htmlOptions);
 }
Пример #4
0
 /**
  * Error Summary
  *
  * A wrapper for the errorSummary() method in the parent class, CActiveForm, to allow for form objects to be
  * passed as well as form models.
  *
  * @access public
  * @param CForm|CModel $formModel
  * @param string $header
  * @param string $footer
  * @param array $htmlOptions
  * @return string
  */
 public function errorSummary($formModel, $header = null, $footer = null, $htmlOptions = array())
 {
     if ($formModel instanceof \CForm && isset($formModel->model) && $formModel->model instanceof \CModel) {
         $formModel = $formModel->model;
     }
     return parent::errorSummary($formModel, $header, $footer, $htmlOptions);
 }
Пример #5
0
 /**
  * Displays a summary of validation errors for one or several models.
  * This method is very similar to {@link TbHtml::errorSummary} except that it also works
  * when AJAX validation is performed.
  * @param mixed $models the models whose input errors are to be displayed. This can be either
  * a single model or an array of models.
  * @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.
  * @see TbHtml::errorSummary
  */
 public function errorSummary($models, $header = null, $footer = null, $htmlOptions = array())
 {
     $htmlOptions = TbHtml::addClassName('alert alert-block alert-error', $htmlOptions);
     return parent::errorSummary($models, $header, $footer, $htmlOptions);
 }
Пример #6
0
 public function run()
 {
     echo $this->form->errorSummary($this->model);
     $this->renderContent();
 }
Пример #7
0
 public function errorSummary($models, $header = null, $footer = null, $htmlOptions = array())
 {
     $htmlOptions['class'] = $this->errorMessageCssClass;
     return parent::errorSummary($models, $header, $footer, $htmlOptions);
 }
Пример #8
0
if (($c = count($models)) == 0) {
    ?>
    <h5>нет купонов</h5>
<?php 
}
?>
    <script>
        var COUPON_CNT = <?php 
echo $c;
?>
;
    </script>
<?php 
$form = new CActiveForm();
foreach ($models as $i => $model) {
    echo $form->errorSummary($model);
    ?>
<a href="#edit" class="flag">
    <div class="percent"><?php 
    echo $model->percent;
    ?>
%</div>
        <div class="info">
                <div class="vd"><?php 
    echo $model->price;
    ?>
 VD</div>
                <div class="buy">Купить <?php 
    echo $model->type == 0 ? "скидку" : "сертификат";
    ?>
</div>