Skip to content

Commit

Permalink
Add new locator schema templates://
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoHood committed Nov 9, 2020
1 parent 54dccd1 commit 7fb0b63
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions system/src/Grav/Common/Twig/Twig.php
Expand Up @@ -103,6 +103,9 @@ public function init()
$this->twig_paths = array_merge($this->twig_paths, $core_templates);

$this->loader = new \Twig_Loader_Filesystem($this->twig_paths);

// Add all template path as schema for locator
$locator->addPath('templates', '', $this->twig_paths);

// Register all other prefixes as namespaces in twig
foreach ($locator->getPaths('theme') as $prefix => $_) {
Expand Down

0 comments on commit 7fb0b63

Please sign in to comment.