Views documentation and $view->setThemeHandle example code

Rendering a View Object

Example of a GET route /account/activate rendering a view:

$router->get('/account/activate', function() use ($app) {
    $factory = $app->make(\Concrete\Core\Http\ResponseFactoryInterface::class);
    $view = new \Concrete\Core\View\View(‘/account/activate/form’);
    $view->setThemeHandle(‘green_salad’);
    return $factory->createResponse($view->render());
});

\Concrete\Core\View\View does not have a method named setThemeHandle, going as far back as 8.2.1 and as far forward as 9.1.3.

Found here https://documentation.concretecms.org/9-x/developers/security/route#heading-22

Additionally, in code blocks, it would be better if the code used straight quotes (’ ") instead of curly (ie: typesetter) quotation (’) marks.

I’ve gone ahead and swapped out the curly quotes with straigth quotes. I’ll log the method issue in our tracker. Thanks!

All right and I updated that method - I believe it should be setViewTheme() - let me know if that looks better for you.