32 $mainOptions = $menuOptions = [];
34 if (!empty($params[
'mainButton']))
36 $mainOptions = $params[
'mainButton'];
38 if (!empty($params[
'menuButton']))
40 $menuOptions = $params[
'menuButton'];
42 unset($params[
'tag']);
44 $mainOptions[
'buttonType'] = Type::MAIN;
45 $menuOptions[
'buttonType'] = Type::MENU;
47 $this->mainButton =
new SubButton($mainOptions);
48 $this->menuButton =
new SubButton($menuOptions);
49 $this->mainButton->setSplitButton($this);
50 $this->menuButton->setSplitButton($this);
52 if (isset($params[
'menuTarget']) && $params[
'menuTarget'] === Type::MENU)
54 $this->menuTarget = Type::MENU;
57 parent::buildFromArray($params);
106 $attributes = parent::appendDefaultJsonOption($attributes);
111 $mainButtonAttributes = clone
$mainButton->getAttributeCollection();
112 $mainButton->appendDefaultJsonOption($mainButtonAttributes);
114 $menuButtonAttributes = clone
$menuButton->getAttributeCollection();
115 $menuButton->appendDefaultJsonOption($menuButtonAttributes);
117 if ($mainButtonAttributes->getJsonOptions())
119 $attributes->
addJsonOption(
'mainButton', $mainButtonAttributes->getJsonOptions());
122 if ($menuButtonAttributes->getJsonOptions())
124 $attributes->
addJsonOption(
'menuButton', $menuButtonAttributes->getJsonOptions());