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