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