Answer the question
In order to leave comments, you need to log in
How to change directory for Twig templates?
Hi all.
How to change template call directory in Twig?
\theme
->layouts\admin.twig
->admin\login.twig
{% extends "layouts/admin.twig" %}
{% block content %}
Content of the page...
{% endblock %}
Twig_Error_Loader [ Error ]:
Looks like you try to load a template outside configured directories (../layouts/adminpage.twig) in "login.twig" at line 1.
Answer the question
In order to leave comments, you need to log in
require_once '/path/to/lib/Twig/Autoloader.php';
Twig_Autoloader::register();
$loader = new Twig_Loader_Filesystem('/theme');
$twig = new Twig_Environment($loader, array());
{% extends "layouts/admin.twig" %} // theme/layouts/admin.twig
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question