phpMv  -UI toolkit 2.4.12
jQuery, jQuery UI, Twitter Bootstrap and Semantic-UI library for php & php MVC Frameworks
HtmlAccordion.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Ajax\bootstrap\html;
4 
6 use Ajax\JsUtils;
7 
8 
16 
17  public function __construct($identifier, $tagName="div") {
18  parent::__construct($identifier, $tagName);
19  $this->setClass("panel-group");
20  $this->setRole("tablist");
21  $this->setProperty("aria-multiselectable", "true");
22  $this->content=array ();
23  }
24 
25  public function addPanel($title, $content) {
26  $nb=sizeof($this->content)+1;
27  $panel=new HtmlPanel("panel-".$this->identifier."-".$nb);
28  $link=new HtmlLink("lnk-panel-".$this->identifier."-".$nb);
29  $link->setProperty("data-toggle", "collapse");
30  $link->setProperty("data-parent", "#".$this->identifier);
31  $link->setHref("#collapse-panel-".$this->identifier."-".$nb);
32  $link->setContent($title);
33  $panel->addHeader($link);
34  $panel->setContent($content);
35  $panel->setCollapsable(true);
36  $this->content []=$panel;
37  return $panel;
38  }
39 
48  public function renderViewPanel(JsUtils $js,$title,$initialController, $viewName, $params=array()) {
49  return $this->addPanel($title, $js->renderContent($initialController, $viewName,$params));
50  }
51 
61  public function forwardPanel(JsUtils $js,$title,$initialController,$controller,$action,$params=array()){
62  return $this->addPanel($title, $js->forward($initialController, $controller, $action,$params));
63  }
64 
65  public function run(JsUtils $js) {
66  foreach ( $this->content as $content ) {
67  $content->run($js);
68  }
69  }
70 
71  public function getPanel($index) {
72  if ($index<sizeof($this->content))
73  return $this->content [$index];
74  }
75 }
renderViewPanel(JsUtils $js, $title, $initialController, $viewName, $params=array())
render the content of an existing view : $controller/$action and set the response to a new panel ...
__construct($identifier, $tagName="div")
Composant Twitter Bootstrap Accordion.
forward($initialController, $controller, $action, $params)
Forwards to.
JQuery PHP library.
Definition: JsUtils.php:23
forwardPanel(JsUtils $js, $title, $initialController, $controller, $action, $params=array())
render the content of
renderContent($initialControllerInstance, $viewName, $params=NULL)
render the content of an existing view : $viewName and set the response to the modal content Used int...
Composant Twitter Bootstrap panel.
Definition: HtmlPanel.php:16