本文整理匯總了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;
}