/** * Test the view paths listed in config constant APP_TEST_VIEW_PATH_LIST * by validating the HTML as well-formatted and legal XHTML. */ public function view_paths_test() { foreach ($this->view_paths as $view_path) { $html = uri_get_contents(AppView::uri($view_path)); $errors = $this->app->xhtml_errors($html); $this->should("validate \"{$view_path}\" as XHTML", !$errors, $errors); } }
/** * Render a content-type file in the "types" folder * * @param String $type the type file to render * @param Object $render an optional Object containing render data * @param Array $options an optional array of options (e.g. "must_find") * @return String the rendered output to be returned to the client */ public function render_type($type, $render, $options = array()) { $options['must_find'] = TRUE; // Optionally render the content in some layout $layout = $render->layout; if ($layout) { $options[Symbol::FOLDER] = 'layouts'; $content = $this->render_view("{$layout}.{$type}", $render, $options); if (isset($content)) { $render->content = $content; } } // Render the content in a content-type wrapper $options[Symbol::FOLDER] = 'types'; $content = $this->render_view($type, $render, $options); if (is_null($content)) { $content = uri_get_contents('not/found'); } return $content; }