| @@ 200-213 (lines=14) @@ | ||
| 197 | * @param Dispatcher $dispatcher the request dispatcher |
|
| 198 | * @return \Ajax\bootstrap\html\HtmlBreadcrumbs |
|
| 199 | */ |
|
| 200 | public function fromDispatcher($dispatcher,$startIndex=0){ |
|
| 201 | $this->startIndex=$startIndex; |
|
| 202 | $params=$dispatcher->getParams(); |
|
| 203 | $action=$dispatcher->getActionName(); |
|
| 204 | $items=array($dispatcher->getControllerName()); |
|
| 205 | if(\sizeof($params)>0 || \strtolower($action)!="index" ){ |
|
| 206 | $items[]=$action; |
|
| 207 | foreach ($params as $p){ |
|
| 208 | if(\is_object($p)===false) |
|
| 209 | $items[]=$p; |
|
| 210 | } |
|
| 211 | } |
|
| 212 | return $this->addElements($items); |
|
| 213 | } |
|
| 214 | ||
| 215 | ||
| 216 | /** |
|
| @@ 86-99 (lines=14) @@ | ||
| 83 | * @param Dispatcher $dispatcher the request dispatcher |
|
| 84 | * @return \Ajax\bootstrap\html\HtmlBreadcrumbs |
|
| 85 | */ |
|
| 86 | public function fromDispatcher($dispatcher,$startIndex=0){ |
|
| 87 | $this->startIndex=$startIndex; |
|
| 88 | $params=$dispatcher->getParams(); |
|
| 89 | $action=$dispatcher->getActionName(); |
|
| 90 | $items=array($dispatcher->getControllerName()); |
|
| 91 | if(\sizeof($params)>0 || \strtolower($action)!="index" ){ |
|
| 92 | $items[]=$action; |
|
| 93 | foreach ($params as $p){ |
|
| 94 | if(\is_object($p)===false) |
|
| 95 | $items[]=$p; |
|
| 96 | } |
|
| 97 | } |
|
| 98 | return $this->addItems($items); |
|
| 99 | } |
|
| 100 | ||
| 101 | /** |
|
| 102 | * Return the url of the element at $index or the breadcrumbs url if $index is ommited |
|