/**
  * Add new elements in breadcrumbs corresponding to request dispatcher : controllerName, actionName, parameters
  * @param JsUtils $js
  * @param Dispatcher $dispatcher the request dispatcher
  * @return \Ajax\bootstrap\html\HtmlBreadcrumbs
  */
 public function fromDispatcher(JsUtils $js, $dispatcher, $startIndex = 0)
 {
     return $this->addItems($js->fromDispatcher($dispatcher));
 }
 /**
  * Add new elements in breadcrumbs corresponding to request dispatcher : controllerName, actionName, parameters
  * @param JsUtils $js
  * @param Dispatcher $dispatcher the request dispatcher
  * @return \Ajax\bootstrap\html\HtmlBreadcrumbs
  */
 public function fromDispatcher(JsUtils $js, $dispatcher, $startIndex = 0)
 {
     $this->startIndex = $startIndex;
     return $this->addElements($js->fromDispatcher($dispatcher));
 }
 /**
  * set the active page corresponding to request dispatcher : controllerName, actionName, parameters and $urlMask
  * @param JsUtils $js
  * @param Dispatcher $dispatcher the request dispatcher
  * @return \Ajax\bootstrap\html\HtmlPagination
  */
 public function fromDispatcher(JsUtils $js, $dispatcher, $startIndex = 0)
 {
     $items = $js->fromDispatcher($dispatcher);
     $url = implode("/", $items);
     if ($this->urlMask === "%page%") {
         $this->urlMask = preg_replace("/[0-9]/", "%page%", $url);
     }
     for ($index = $this->from; $index <= $this->to; $index++) {
         if ($this->getUrl($index) == $url) {
             $this->setActive($index);
             break;
         }
     }
     return $this;
 }