本文整理汇总了PHP中BsHtml::addCssStyle方法的典型用法代码示例。如果您正苦于以下问题:PHP BsHtml::addCssStyle方法的具体用法?PHP BsHtml::addCssStyle怎么用?PHP BsHtml::addCssStyle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BsHtml
的用法示例。
在下文中一共展示了BsHtml::addCssStyle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: errorSummary
/**
* 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);
}
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'];
foreach (is_array($models) ? $models : array($models) as $model) {
foreach ($model->getSafeAttributeNames() as $attribute) {
$this->_summaryAttributes[] = CHtml::activeId($model, $attribute);
}
}
return $html;
}