{{ entry.title }}
-{{ entry.content|striptags|slice(0, 300) }}…
-diff --git a/app/app.php b/app/app.php index 3f6d5da..9542152 100644 --- a/app/app.php +++ b/app/app.php @@ -20,6 +20,13 @@ $app->before(function () use ($app) { $app['twig']->addGlobal('layout', $app['twig']->loadTemplate('layout.twig')); }); +$app['twig'] = $app->share($app->extend('twig', function($twig) { + $twig->addFilter(new Twig_SimpleFilter('getDomain', function ($url) { + return parse_url($url, PHP_URL_HOST); + })); + return $twig; +})); + $app->register(new ConsoleServiceProvider(), [ 'console.name' => 'Poche console', 'console.version' => '0.1', diff --git a/app/views/_entry.twig b/app/views/_entry.twig index 27db457..d392cfe 100644 --- a/app/views/_entry.twig +++ b/app/views/_entry.twig @@ -1,10 +1,10 @@ -
{{ entry.content|striptags|slice(0, 300) }}…
-