本文整理汇总了PHP中yii\bootstrap\Html::removeCssClass方法的典型用法代码示例。如果您正苦于以下问题:PHP Html::removeCssClass方法的具体用法?PHP Html::removeCssClass怎么用?PHP Html::removeCssClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\bootstrap\Html
的用法示例。
在下文中一共展示了Html::removeCssClass方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* @inheritdoc
*/
public function run()
{
//register assets
$this->registerPlugin('button');
AjaxToggleButtonAsset::register($this->getView());
//prepare ajax params
$params = [];
foreach ($this->model->primaryKey() as $pkCol) {
$params[$pkCol] = $this->model->{$pkCol};
}
Html::addCssClass($this->options, 'widget-ajax-button');
if ($this->model->{$this->booleanAttribute}) {
Html::removeCssClass($this->options, $this->buttonClassOff);
Html::addCssClass($this->options, $this->buttonClassOn);
} else {
Html::removeCssClass($this->options, $this->buttonClassOn);
Html::addCssClass($this->options, $this->buttonClassOff);
}
$this->options['data']['current-value'] = $this->model->{$this->booleanAttribute};
$this->options['data']['pjax'] = 0;
$this->options['data']['boolean-format'] = $this->booleanFormat;
$this->options['data']['ajax-params'] = $params;
$this->options['data']['ajax-method'] = $this->ajaxMethod;
$this->options['data']['event-success'] = $this->jsEventSuccess;
$this->options['data']['event-error'] = $this->jsEventError;
$this->options['data']['class-on'] = $this->buttonClassOn;
$this->options['data']['class-off'] = $this->buttonClassOff;
return Html::a($this->createLabel(), $this->ajaxUrl, $this->options);
}
示例2: noBlock
/**
* @return self
*/
public function noBlock()
{
Html::removeCssClass($this->options, self::BTN_BLOCK);
return $this;
}