prepend($title); break; case self::SET: $this->set($title); break; default: $this->append($title); break; } } return $this; } /** * * append string to title container * * @param string $title * * @return $this */ public function append($title) { array_push($this->_container, $title); return $this; } /** * * prepend string to title container * * @param string $title * * @return $this */ public function prepend($title) { array_unshift($this->_container, $title); return $this; } /** * * set new title * * @param $title * * @return $this */ public function set($title) { $this->clearContainer() ->append($title); return $this; } /** * * clear title container * * @return $this */ public function clearContainer() { $this->_container = array(); return $this; } /** * * set title separator * * @param string $separator * * @return $this */ public function setSeparator($separator) { $this->_separator = $separator; return $this; } /** * * get title separator * * @return string */ public function getSeparator() { return $this->_separator; } /** * * to string magic method * * enables echo $this->headTitle(); * * @return string */ public function __toString() { return '' . implode($this->_separator, $this->_container) . ''; } }