本文整理汇总了PHP中yii\bootstrap\ButtonDropdown::init方法的典型用法代码示例。如果您正苦于以下问题:PHP ButtonDropdown::init方法的具体用法?PHP ButtonDropdown::init怎么用?PHP ButtonDropdown::init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\bootstrap\ButtonDropdown
的用法示例。
在下文中一共展示了ButtonDropdown::init方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
parent::init();
$this->dropdown['items'] = $this->items;
$this->options['class'] = 'btn-' . $this->layout;
if ($this->size) {
$this->options['class'] .= ' btn-' . $this->size;
}
}
示例2: init
public function init()
{
parent::init();
if ($this->selector === null) {
throw new InvalidConfigException('"selector" cannot be empty');
}
$this->encodeLabel = false;
$this->exportClientOptions['table'] = new JsExpression("{$this->options['id']}tableExport");
$this->initDropdownItems();
}
示例3: init
/**
* Inits ButtonDropdown
*/
public function init()
{
parent::init();
$this->options['data-toggle'] = 'dropdown';
if ($this->hover === true) {
$this->options['data-hover'] = 'dropdown';
}
if ($this->encodeLabel) {
$this->label = Html::encode($this->label);
}
$this->options['data-close-others'] = 'true';
Html::addCssClass($this->options, 'btn');
Html::addCssClass($this->options, 'dropdown-toggle');
}
示例4: init
public function init()
{
$route = Yii::$app->controller->route;
$appLanguage = Yii::$app->language;
$params = $_GET;
$items = [];
array_unshift($params, $route);
foreach (Yii::$app->localeUrls->languages as $language) {
if ($language === $appLanguage) {
continue;
// Exclude the current language
}
$params['language'] = $language;
$items[] = ['label' => self::label($language), 'url' => Yii::$app->urlManager->createUrl($params)];
}
$this->dropdown['items'] = $items;
parent::init();
}