ViewSetup
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
:
You can also use the namespace
to include
and extend
templates.
Extending Twig
ViewSetup
extends this way of extending Twig.
Globals
Filters
We instantiate a
\Twig\TwigFilter
class for you so you need to provide the data for that.
Functions
We instantiate a
\Twig\TwigFunction
class for you so you need to provide the data for that.
Tests
We instantiate a
\Twig\TwigTest
class for you so you need to provide the data for that.
Advanced Extension
We also offer support for the more advanced ways of extending Twig.
Tags
Extensions
RuntimeLoader
Last updated
Was this helpful?