Created
March 6, 2019 21:54
-
-
Save alexwoollam/b65be2f865c0d22db377447fd30bb4c9 to your computer and use it in GitHub Desktop.
It's possible to use namespaces by hooking onto the timber/loader/loader filter.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'timber/loader/loader', function( $loader ){ | |
$loader->addPath( __DIR__ . "/views/components", "components" ); | |
return $loader; | |
} ); | |
// To use the namespace in your Twig template, just include it with an @ prefix. | |
{{ include( '@components/filename.twig' ) }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment