Refactoring Menu 1st step: Permissions

- added config permissions to setup our capabilities
- added debug mode for Twig so that we can use "dump()" when WP_DEBUG is on
This commit is contained in:
Jonathan Labreuille
2015-10-14 16:58:50 +02:00
parent e24263e067
commit c8c3f09fb2
10 changed files with 240 additions and 54 deletions

View File

@ -12,11 +12,15 @@ class Renderer {
$file_system = new TwigFileSystem(Env::$views_path);
$this->renderer = new TwigEnv(
$file_system,
array('cache' => $this->detectCache())
array(
'cache' => $this->detectCache(),
'debug' => WP_DEBUG
)
);
}
function init() {
$this->setupDebug();
$this->setupTranslations();
$this->setupFunctions();
$this->setupHandlebars();
@ -61,4 +65,10 @@ class Renderer {
}
return false;
}
function setupDebug() {
if(WP_DEBUG === true) {
$this->renderer->addExtension(new \Twig_Extension_Debug());
}
}
}