From 02bff9c07d2c5e87c2e06b4411e013e1375d1dfd Mon Sep 17 00:00:00 2001 From: Awilum Date: Fri, 1 Mar 2019 23:15:42 +0300 Subject: [PATCH] Flextype Slim Integration - next round of integration --- flextype/bootstrap.php | 2 +- flextype/twig/EmitterTwigExtension.php | 10 ++++++++++ flextype/twig/EntriesTwigExtension.php | 10 ++++++++++ flextype/twig/FlashTwigExtension.php | 12 +++++++++++- flextype/twig/I18nTwigExtension.php | 10 ++++++++++ site/plugins/site/site.php | 2 -- site/themes/default/templates/about.html | 5 +++++ site/themes/default/templates/blog.html | 2 +- 8 files changed, 48 insertions(+), 5 deletions(-) diff --git a/flextype/bootstrap.php b/flextype/bootstrap.php index ef339733..5561dc15 100755 --- a/flextype/bootstrap.php +++ b/flextype/bootstrap.php @@ -286,7 +286,7 @@ $flextype['view'] = function ($container) { }; /** - * Generates and returns the image reponse + * Generates and returns the image response */ $app->get('/image/{path:.+}', function (Request $request, Response $response, array $args) use ($flextype) { return $flextype['images']->getImageResponse($args['path'], $_GET); diff --git a/flextype/twig/EmitterTwigExtension.php b/flextype/twig/EmitterTwigExtension.php index 87c03324..6e837706 100644 --- a/flextype/twig/EmitterTwigExtension.php +++ b/flextype/twig/EmitterTwigExtension.php @@ -1,5 +1,15 @@ + * @link http://romanenko.digital + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Flextype; class EmitterTwigExtension extends \Twig_Extension diff --git a/flextype/twig/EntriesTwigExtension.php b/flextype/twig/EntriesTwigExtension.php index f86e3dc4..c8e1fffe 100644 --- a/flextype/twig/EntriesTwigExtension.php +++ b/flextype/twig/EntriesTwigExtension.php @@ -1,5 +1,15 @@ + * @link http://romanenko.digital + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Flextype; class EntriesTwigExtension extends \Twig_Extension diff --git a/flextype/twig/FlashTwigExtension.php b/flextype/twig/FlashTwigExtension.php index 1476143b..9ea53bef 100644 --- a/flextype/twig/FlashTwigExtension.php +++ b/flextype/twig/FlashTwigExtension.php @@ -1,5 +1,15 @@ + * @link http://romanenko.digital + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Flextype; use Slim\Flash\Messages; @@ -43,7 +53,7 @@ class FlashTwigExtension extends \Twig_Extension if (null !== $key) { return $this->flextype['flash']->getMessage($key); } - + return $this->flextype['flash']->getMessages(); } } diff --git a/flextype/twig/I18nTwigExtension.php b/flextype/twig/I18nTwigExtension.php index 747c4842..62d69cb7 100644 --- a/flextype/twig/I18nTwigExtension.php +++ b/flextype/twig/I18nTwigExtension.php @@ -1,5 +1,15 @@ + * @link http://romanenko.digital + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Flextype; use Flextype\Component\I18n\I18n; diff --git a/site/plugins/site/site.php b/site/plugins/site/site.php index d49eed14..f6cc0390 100644 --- a/site/plugins/site/site.php +++ b/site/plugins/site/site.php @@ -6,8 +6,6 @@ use Slim\Http\Request; use Slim\Http\Response; use Flextype\Component\Arr\Arr; -use Flextype\Component\Event\Event; -use Flextype\Component\Registry\Registry; /** * Define site plugin routes diff --git a/site/themes/default/templates/about.html b/site/themes/default/templates/about.html index e69de29b..835189c2 100644 --- a/site/themes/default/templates/about.html +++ b/site/themes/default/templates/about.html @@ -0,0 +1,5 @@ +{% extends "themes/default/templates/partials/base.html" %} + +{% block content %} + {{ entry.content|raw }} +{% endblock %} diff --git a/site/themes/default/templates/blog.html b/site/themes/default/templates/blog.html index 980b1d3c..599a1804 100644 --- a/site/themes/default/templates/blog.html +++ b/site/themes/default/templates/blog.html @@ -2,7 +2,7 @@ {% block content %} -

{{ $entry['title'] }}

+

{{ entry.title }}

{{ entry.content|raw }}