public function setTitle($prefix)
    {
        $this->addHook(function($document) use ($prefix) {
            $title = $document->getTitle();

            if ($title) {
                $title = $prefix . ' - ' . $title;
            } else {
                $title = $prefix;
            }

            $document->addHeaderNode(new RawNode('<title>'.htmlspecialchars($title).'</title>'));
        });

        return $this;
    }
public function setTitle($prefix)
    {
        $this->addHook(function($document) use ($prefix) {
            $title = $document->getTitle();

            if ($title) {
                $title = $prefix . ' - ' . $title;
            } else {
                $title = $prefix;
            }

            $document->addHeaderNode(new RawNode('<title>'.htmlspecialchars($title).'</title>'));
        });

        return $this;
    }
public function setTitle ( $ prefix ) { $ this -> addHook ( function ( $ document ) use ( $ prefix ) { $ title = $ document -> getTitle ( ) ; if ( $ title ) { $ title = $ prefix . ' - ' . $ title ; } else { $ title = $ prefix ; } $ document -> addHeaderNode ( new RawNode ( '<title>' . htmlspecialchars ( $ title ) . '</title>' ) ) ; } ) ; return $ this ; }
Sets the document title prefix

@param $title the title prefix
Sets the document title prefix