本文整理汇总了PHP中ZurmoHtml::errorSummary方法的典型用法代码示例。如果您正苦于以下问题:PHP ZurmoHtml::errorSummary方法的具体用法?PHP ZurmoHtml::errorSummary怎么用?PHP ZurmoHtml::errorSummary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZurmoHtml
的用法示例。
在下文中一共展示了ZurmoHtml::errorSummary方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: errorSummary
/**
* Override to handle relation model error summary information. This information needs to be parsed properly
* otherwise it will show up as 'Array' for the error text.
* @see CActiveForm::errorSummary()
*/
public function errorSummary($models, $header = null, $footer = null, $htmlOptions = array())
{
if (!$this->enableAjaxValidation && !$this->enableClientValidation) {
return ZurmoHtml::errorSummary($models, $header, $footer, $htmlOptions);
}
if (!isset($htmlOptions['id'])) {
$htmlOptions['id'] = $this->id . '_es_';
}
$html = ZurmoHtml::errorSummary($models, $header, $footer, $htmlOptions);
if ($html === '') {
if ($header === null) {
$header = '<p>' . Yii::t('yii', 'Please fix the following input errors:') . '</p>';
}
if (!isset($htmlOptions['class'])) {
$htmlOptions['class'] = ZurmoHtml::$errorSummaryCss;
}
if (isset($htmlOptions['style'])) {
$htmlOptions['style'] = rtrim($htmlOptions['style'], ';') . ';display:none';
} else {
$htmlOptions['style'] = 'display:none';
}
$html = ZurmoHtml::tag('div', $htmlOptions, $header . "\n<ul><li>dummy</li></ul>" . $footer);
}
$this->summaryID = $htmlOptions['id'];
return $html;
}
示例2: processSelectFromRelatedListSaveFails
protected function processSelectFromRelatedListSaveFails(RedBeanModel $model)
{
$header = Zurmo::t('ZurmoModule', 'Please resolve the following issues for {modelString}:', array('{modelString}' => strval($model)));
echo CJSON::encode(array('message' => ZurmoHtml::errorSummary(array($model), $header), 'messageType' => 'error'));
Yii::app()->end(0, false);
}