本文整理汇总了PHP中yii\helpers\Html::removeCssClass方法的典型用法代码示例。如果您正苦于以下问题:PHP Html::removeCssClass方法的具体用法?PHP Html::removeCssClass怎么用?PHP Html::removeCssClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\helpers\Html
的用法示例。
在下文中一共展示了Html::removeCssClass方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run()
{
echo Html::beginTag('img', $this->options);
$this->options['src'] = ArrayHelper::remove($this->options, 'data-src');
Html::removeCssClass($this->options, 'lazy');
echo '<noscript>' . Html::beginTag('img', $this->options) . '</noscript>';
}
示例2: init
/**
* @inheritdoc
* @throws InvalidConfigException
*/
public function init()
{
if (!class_exists($this->dropdownClass)) {
throw new InvalidConfigException("The dropdownClass '{$this->dropdownClass}' does not exist or is not accessible.");
}
parent::init();
Html::removeCssClass($this->options, 'nav');
}
示例3: init
/**
* @inheritdoc
*/
public function init()
{
$cssClass = @$this->options['class'];
parent::init();
// significant order
if ($cssClass != $this->options['class']) {
\yii\helpers\Html::removeCssClass($this->options, 'nav');
}
$this->items = Item::find()->select(['*', 'parent_id' => '(IF(pid=1,"",pid))', 'name' => 'title'])->where(['visible' => true])->andWhere(['<>', 'pid', ''])->indexBy('id')->orderBy(['rank' => SORT_ASC])->asArray()->all();
}
示例4: init
/**
* @inheritdoc
* @throws \yii\base\InvalidConfigException
*/
public function init()
{
parent::init();
if ($this->label === null) {
$this->label = $this->hasModel() ? $this->model->getAttributeLabel($this->attribute) : ArrayHelper::getValue($this->options, 'label', false);
}
Html::removeCssClass($this->options, 'ui');
Ui::addCssClasses($this->wrapperOptions, ['ui', 'checkbox']);
$this->wrapperOptions['id'] = $this->options['id'] . '-wrapper';
$this->selector = $this->selector ?: '#' . $this->wrapperOptions['id'];
}
示例5: init
/**
* @inheritdoc
*/
public function init()
{
parent::init();
Html::addCssClass($this->containerOptions, 'input-group date');
Html::addCssClass($this->options, 'form-control');
$this->options['readonly'] = 'readonly';
if ($this->size !== null) {
$size = 'input-' . $this->size;
Html::addCssClass($this->options, $size);
Html::addCssClass($this->containerOptions, $size);
}
if ($this->inline) {
$this->clientOptions['linkField'] = $this->options['id'];
Html::removeCssClass($this->containerOptions, 'date');
Html::removeCssClass($this->containerOptions, 'input-group');
Html::addCssClass($this->options, 'text-center');
}
}
示例6: init
public function init()
{
parent::init();
Html::removeCssClass($this->options, 'dropdown-menu');
Html::addCssClass($this->options, 'treeview-menu');
}
示例7: testRemoveCssClass
public function testRemoveCssClass()
{
$options = ['class' => 'test test2 test3'];
Html::removeCssClass($options, 'test2');
$this->assertEquals(['class' => 'test test3'], $options);
Html::removeCssClass($options, 'test2');
$this->assertEquals(['class' => 'test test3'], $options);
Html::removeCssClass($options, 'test');
$this->assertEquals(['class' => 'test3'], $options);
Html::removeCssClass($options, 'test3');
$this->assertEquals([], $options);
}
示例8: init
/**
* Initializes the widget.
*/
public function init()
{
parent::init();
Html::removeCssClass($this->options, ['widget' => 'nav']);
Html::addCssClass($this->options, ['navlist' => $this->warpClass]);
}
示例9: rc
/**
* Removes css class from the icon
* @param string $class
* @return $this
*/
public function rc($class)
{
Html::removeCssClass($this->options, $class);
return $this;
}
示例10: switcher
/**
* Renders switcher
* @see http://materializecss.com/forms.html#switches
* @param array $options
* @param array $flags
* @return $this
*/
public function switcher($options = [], $flags = null)
{
parent::checkbox($options, false);
if ($flags === null) {
$label = Html::encode($this->model->getAttributeLabel(Html::getAttributeName($this->attribute)));
$labelParts = explode(',', $label);
$flags = count($labelParts) >= 2 ? $labelParts : null;
}
if ($flags) {
Html::removeCssClass($this->options, 'input-field');
Html::addCssClass($this->options, 'switch');
$labelContent = $flags[0] . $this->parts['{input}'] . Html::tag('span', '', ['class' => 'lever']) . $flags[1];
$this->parts['{input}'] = Html::label($labelContent, Html::getInputId($this->model, $this->attribute));
}
return $this;
}
示例11: init
/**
* @inheritdoc
*/
public function init()
{
$this->_view = $this->grid->getView();
if ($this->mergeHeader && !isset($this->vAlign)) {
$this->vAlign = GridView::ALIGN_MIDDLE;
}
if ($this->grid->bootstrap === false) {
Html::removeCssClass($this->filterInputOptions, 'form-control');
}
$this->parseFormat();
$this->parseVisibility();
$this->checkValidFilters();
parent::init();
$this->setPageRows();
$this->initGrouping();
}
示例12:
* +------------------------------------------------------------------------------
* @Description
* +------------------------------------------------------------------------------
* @filename index.php
* @encoding UTF-8
* @author xingcuntian<xingcuntian@sxxl.com>
* @datetime 2015-07-03 11:02:40
* @version 1.0
* +------------------------------------------------------------------------------
*/
echo Html::tag('p', Html::encode('username'), ['class' => 'username']);
echo Html::tag('div', Html::encode("dddddddddddddddddd"), ['class' => 'div', 'id' => 'div']);
$options = ['class' => 'btn btn-default'];
$type = 'success';
if ($type === 'success') {
Html::removeCssClass($options, 'btn-default');
Html::addCssClass($options, 'btn-success');
}
echo Html::tag('div', 'sdsdsd dddd', $options);
$id = 2;
$option = [['id' => 1, 'name' => 'one'], ['id' => 2, 'name' => 'two'], ['id' => 3, 'name' => 'three'], ['id' => 4, 'name' => 'four']];
$post = ['title' => 'this is title', 'name' => 'this is name', 'child' => [1000, 200]];
echo Html::getInputName($model, 'username');
echo Html::getAttributeValue($model, 'username');
echo Html::tag('hr');
echo Html::getInputId($model, 'username');
echo Html::tag('hr');
?>
<?php
echo Html::style('.username{color:red;font-size:8px;}');
示例13: init
/**
* @inheritdoc
*/
public function init()
{
parent::init();
Html::removeCssClass($this->options, 'nav');
Html::addCssClass($this->options, 'sidebar-menu');
}
示例14: input
/**
* Renders an input tag.
*
* @param string $type the input type (e.g. 'text', 'password')
* @param array $options the tag options in terms of name-value pairs. These will be rendered as
* the attributes of the resulting tag. The values will be HTML-encoded using [[Html::encode()]].
* @return ActiveField object
*/
public function input($type, $options = [])
{
$this->initPlaceholder($options);
if ($type == 'range' || $type == 'color') {
Html::removeCssClass($this->inputOptions, 'form-control');
}
$options = array_merge($this->inputOptions, $options);
$this->parts['{input}'] = Html::activeInput($type, $this->model, $this->attribute, $options);
return $this;
}
示例15: init
/**
* Initializes the widget.
*/
public function init()
{
parent::init();
Html::removeCssClass($this->options, ['nav', $this->navType]);
Html::addCssClass($this->options, 'nav-tabs-custom');
}