v8.4: how to render view without a page
Permalink
Following this:
https://documentation.concrete5.org/developers/framework/routing/vie...
I need to render a my_package/views/test.php view
at a route my_page/topics
but I get an error: "Call to a member function css() on null". If it's to do with "rendering them without a valid page (like in this instance) will cause an error", then how can I render my custom view on a themed page at that route?
https://documentation.concrete5.org/developers/framework/routing/vie...
I need to render a my_package/views/test.php view
at a route my_page/topics
$view = new View('test'); $view->setPackageHandle('my_package'); $view->setViewTheme('elemental'); $this->set('topics', $topics); $view->setController($this); return $this->responseFactory->view($view);
but I get an error: "Call to a member function css() on null". If it's to do with "rendering them without a valid page (like in this instance) will cause an error", then how can I render my custom view on a themed page at that route?
In this case I do get the topics shown on an empty UN-themed page. Although I did set the theme and template the page is not themed.
Any idea, help anyone?
PS. The Documentation page is wrong:
the View class doesn't have the 'setThemeHandle' method