diff --git a/src/lib/PanaceaPageController.php b/src/lib/PanaceaPageController.php index 238dac0..7b46f92 100644 --- a/src/lib/PanaceaPageController.php +++ b/src/lib/PanaceaPageController.php @@ -54,7 +54,7 @@ } try { - $templateView = new PanaceaTemplateView(); + $templateView = new PanaceaTemplateView($this->page); $templateView->addView($this->viewFactory->getView($this->page, $request->__toString())); return $templateView; } diff --git a/src/lib/views/PanaceaTemplateView.php b/src/lib/views/PanaceaTemplateView.php index f44f091..6d6be06 100644 --- a/src/lib/views/PanaceaTemplateView.php +++ b/src/lib/views/PanaceaTemplateView.php @@ -27,11 +27,18 @@ * * @author Tommy Montgomery * @since 2008-10-14 + * + * @param string $title The title of the page */ - public function __construct() { + public function __construct($title = 'Home') { + if (!is_string($title)) { + throw new InvalidTypeException(1, 'string', $title); + } + parent::__construct(); $this->defaultTitle = 'Panacea'; + $this->title = (!empty($title)) ? $title : 'Home'; } /**