phpMv  -UI toolkit 2.4.12
jQuery, jQuery UI, Twitter Bootstrap and Semantic-UI library for php & php MVC Frameworks
HtmlSplitbutton.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Ajax\bootstrap\html;
4 
7 use Ajax\JsUtils;
8 
15 
16  public function __construct($identifier, $value="&nbsp;", $items=array(), $cssStyle="btn-default", $onClick=null) {
17  parent::__construct($identifier, $value, $items, $cssStyle, $onClick);
18  $this->asButton($cssStyle);
19  $this->_template=include 'templates/tplSplitbutton.php';
20  $this->mClass="btn-group";
21  }
22 
28  public function setSize($size) {
29  if (is_int($size)) {
30  return $this->addToMember($this->mClass, CssRef::sizes("btn-group")[$size]);
31  }
32  return $this->addToMemberCtrl($this->mClass, $size, CssRef::sizes("btn-group"));
33  }
34 
35  public function onButtonClick($jsCode) {
36  $this->addEvent("buttonClick", $jsCode);
37  }
38 
39  /*
40  * (non-PHPdoc)
41  * @see BaseHtml::run()
42  */
43  public function run(JsUtils $js) {
44  if ($this->getProperty("role")==="nav") {
45  foreach ( $this->items as $dropdownItem ) {
46  $dropdownItem->runNav($js);
47  }
48  }
49  $this->_bsComponent=$js->bootstrap()->splitbutton("#".$this->identifier);
50  $this->addEventsOnRun($js);
51  return $this->_bsComponent;
52  }
53 }
addEventsOnRun(JsUtils $js=NULL)
__construct($identifier, $value="&nbsp;", $items=array(), $cssStyle="btn-default", $onClick=null)
bootstrap(Bootstrap $bootstrap=NULL)
getter or setter of the Twitter Bootstrap variable
Definition: JsUtils.php:141
addToMember(&$name, $value, $separator=' ')
Definition: BaseHtml.php:99
JQuery PHP library.
Definition: JsUtils.php:23
addEvent($event, $jsCode, $stopPropagation=false, $preventDefault=false)
asButton($cssStyle="btn-primary")
Twitter Bootstrap HTML Dropdown component.
Twitter Bootstrap HTML Splitbutton component.
static sizes($prefix="btn")
Definition: CssRef.php:38
addToMemberCtrl(&$name, $value, $typeCtrl, $separator=" ")
Definition: BaseHtml.php:90