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:
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user