Helper class to set up Twig for use in the network.
Registering a Twig directory
Twig uses a file loader system for registering templates. You can register your own "templates directory" if you want to use Twig templates in your theme or plugin. To do this you'll need to provide a path to the templates and a namespace.
You'll then be able to use your templates through your namespace using a path relative to the provided path when rendering with View:
# To render the file "/src/templates/page.twig"View::render('@myNamespace/page');# or# To render the file "/src/templates/some-path/page.twig"View::render('@myNamespace/some-path/page');
You can also use the namespace to include and extend templates.