diff options
| author | horus | 2021-02-24 15:09:40 +0100 |
|---|---|---|
| committer | horus | 2021-02-24 15:09:40 +0100 |
| commit | e4149f7c536199575a1e6b2b8b54eec1c3c1160c (patch) | |
| tree | 6d2bb6cb165d0f2cbcfc306378e6141d77cef80c /app.php | |
| download | moehring-e4149f7c536199575a1e6b2b8b54eec1c3c1160c.tar.gz | |
initial commit
Diffstat (limited to 'app.php')
| -rw-r--r-- | app.php | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -0,0 +1,19 @@ +<?php + +require __DIR__ . '/vendor/autoload.php'; + +$loader = new \Twig\Loader\FilesystemLoader(__DIR__ . '/views'); +$twig = new \Twig\Environment($loader); # no cache + +$function = new \Twig\TwigFunction('is_active', function($route) { + if ( $_SERVER['REQUEST_URI'] == $route ) { + echo " active "; + } +}); +$twig->addFunction($function); + +$function = new \Twig\TwigFunction('maincss', function() { + echo readfile(__DIR__ . '/public/css/bootstrap.min.css'); +}); + +$twig->addFunction($function); |
