| @@ 111-120 (lines=10) @@ | ||
| 108 | * @param string $separator |
|
| 109 | * @return string |
|
| 110 | */ |
|
| 111 | public function getHref($index=null,$separator="/"){ |
|
| 112 | if(!isset($index)){ |
|
| 113 | $index=sizeof($this->content); |
|
| 114 | } |
|
| 115 | if($this->absolutePaths===true){ |
|
| 116 | return $this->_hrefFunction($this->content[$index]); |
|
| 117 | }else{ |
|
| 118 | return $this->root.implode($separator, array_slice(array_map(function($e){return $this->_hrefFunction($e);}, $this->content),$this->startIndex,$index+1)); |
|
| 119 | } |
|
| 120 | } |
|
| 121 | ||
| 122 | /* |
|
| 123 | * (non-PHPdoc) |
|
| @@ 108-117 (lines=10) @@ | ||
| 105 | * @param string $separator |
|
| 106 | * @return string |
|
| 107 | */ |
|
| 108 | public function getHref($index=null,$separator="/"){ |
|
| 109 | if(!isset($index)){ |
|
| 110 | $index=sizeof($this->content); |
|
| 111 | } |
|
| 112 | if($this->absolutePaths===true){ |
|
| 113 | return $this->_hrefFunction($this->content[$index]); |
|
| 114 | }else{ |
|
| 115 | return $this->root.implode($separator, array_slice(array_map(function($e){return $this->_hrefFunction($e);}, $this->content),$this->startIndex,$index+1)); |
|
| 116 | } |
|
| 117 | } |
|
| 118 | ||
| 119 | /** |
|
| 120 | * sets the function who generates the href elements. default : function($element){return $element->getContent()} |
|