::VIEWTYPE_* constants * @throws {@link InvalidTypeException} */ public function __construct($page = '', $viewType = View::VIEWTYPE_HTML) { parent::__construct($page, $viewType); $this->viewFactory = PanaceaViewFactory::getInstance(); } /** * Gets the default page if none is specified in the URI * * @author Tommy Montgomery * @since 2008-10-18 * * @return string */ public static function getDefaultPageName() { return 'Home'; } /** * Handles the specified request, and generates a * suitable response * * @author Tommy Montgomery * @since 2008-10-05 * @uses Request::create() * @uses HttpUtil::getRequestMethod() * * @throws {@link InvalidRequestException} if a {@link View} cannot be created * @return PanaceaTemplateView */ public function handleRequest(Request $request = null) { if (!($request instanceof Request)) { $request = Request::create(HttpUtil::getRequestMethod()); } try { $title = (empty($this->page) || $this->page === 'Home') ? 'It doesn\'t suck' : $this->page; $templateView = new PanaceaTemplateView($title); $templateView->mainView->addView($this->viewFactory->getView($this->page)); return $templateView; } catch (ClassNotFoundException $e) { throw new InvalidRequestException($request); } } } ?>