From 39598d8608c34af4ec47b1622777b80c9f624bbc Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Tue, 19 Jul 2016 18:32:59 +0200 Subject: [PATCH] Moved templates and templates config to Core module --- config/autoload/templates.global.php | 6 ------ config/autoload/zend-expressive.global.php | 8 +------- module/Core/config/templates.config.php | 11 +++++++++++ module/Core/config/zend-expressive.config.php | 12 ++++++++++++ .../Core/templates/core}/error/404.html.twig | 2 +- .../Core/templates/core}/error/error.html.twig | 2 +- .../Core/templates/core}/layout/default.html.twig | 0 7 files changed, 26 insertions(+), 15 deletions(-) create mode 100644 module/Core/config/templates.config.php create mode 100644 module/Core/config/zend-expressive.config.php rename {templates => module/Core/templates/core}/error/404.html.twig (89%) rename {templates => module/Core/templates/core}/error/error.html.twig (91%) rename {templates => module/Core/templates/core}/layout/default.html.twig (100%) diff --git a/config/autoload/templates.global.php b/config/autoload/templates.global.php index 2beb9918..f102baa0 100644 --- a/config/autoload/templates.global.php +++ b/config/autoload/templates.global.php @@ -2,12 +2,6 @@ return [ - 'templates' => [ - 'paths' => [ - 'templates' - ], - ], - 'twig' => [ 'cache_dir' => 'data/cache/twig', 'extensions' => [ diff --git a/config/autoload/zend-expressive.global.php b/config/autoload/zend-expressive.global.php index b2102394..aa2e9d3b 100644 --- a/config/autoload/zend-expressive.global.php +++ b/config/autoload/zend-expressive.global.php @@ -1,14 +1,8 @@ false, + 'debug' => false, 'config_cache_enabled' => true, - 'zend-expressive' => [ - 'error_handler' => [ - 'template_404' => 'error/404.html.twig', - 'template_error' => 'error/error.html.twig', - ], - ], ]; diff --git a/module/Core/config/templates.config.php b/module/Core/config/templates.config.php new file mode 100644 index 00000000..da3623c1 --- /dev/null +++ b/module/Core/config/templates.config.php @@ -0,0 +1,11 @@ + [ + 'paths' => [ + 'module/Core/templates', + ], + ], + +]; diff --git a/module/Core/config/zend-expressive.config.php b/module/Core/config/zend-expressive.config.php new file mode 100644 index 00000000..c5fefe8f --- /dev/null +++ b/module/Core/config/zend-expressive.config.php @@ -0,0 +1,12 @@ + [ + 'error_handler' => [ + 'template_404' => 'core/error/404.html.twig', + 'template_error' => 'core/error/error.html.twig', + ], + ], + +]; diff --git a/templates/error/404.html.twig b/module/Core/templates/core/error/404.html.twig similarity index 89% rename from templates/error/404.html.twig rename to module/Core/templates/core/error/404.html.twig index 0e591e2a..0c28f29d 100644 --- a/templates/error/404.html.twig +++ b/module/Core/templates/core/error/404.html.twig @@ -1,4 +1,4 @@ -{% extends 'layout/default.html.twig' %} +{% extends 'core/layout/default.html.twig' %} {% block title %}URL Not Found{% endblock %} diff --git a/templates/error/error.html.twig b/module/Core/templates/core/error/error.html.twig similarity index 91% rename from templates/error/error.html.twig rename to module/Core/templates/core/error/error.html.twig index cd54354e..c93b3b7e 100644 --- a/templates/error/error.html.twig +++ b/module/Core/templates/core/error/error.html.twig @@ -1,4 +1,4 @@ -{% extends 'layout/default.html.twig' %} +{% extends 'core/layout/default.html.twig' %} {% block title %}{{ status }} {{ reason }}{% endblock %} diff --git a/templates/layout/default.html.twig b/module/Core/templates/core/layout/default.html.twig similarity index 100% rename from templates/layout/default.html.twig rename to module/Core/templates/core/layout/default.html.twig