本文整理汇总了PHP中CActiveForm::errorSummary方法的典型用法代码示例。如果您正苦于以下问题:PHP CActiveForm::errorSummary方法的具体用法?PHP CActiveForm::errorSummary怎么用?PHP CActiveForm::errorSummary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CActiveForm
的用法示例。
在下文中一共展示了CActiveForm::errorSummary方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: errorSummary
public function errorSummary($models, $header = NULL, $footer = NULL, $htmlOptions = array())
{
$header = '<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>';
$footer = '';
$htmlOptions = array_merge(array('class' => 'alert alert-danger'), $htmlOptions);
return parent::errorSummary($models, $header, $footer, $htmlOptions);
}
示例2: errorSummary
/**
*### .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: errorSummary
/**
* 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: errorSummary
/**
* 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: errorSummary
/**
* 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: run
public function run()
{
echo $this->form->errorSummary($this->model);
$this->renderContent();
}
示例7: errorSummary
public function errorSummary($models, $header = null, $footer = null, $htmlOptions = array())
{
$htmlOptions['class'] = $this->errorMessageCssClass;
return parent::errorSummary($models, $header, $footer, $htmlOptions);
}
示例8: CActiveForm
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>