html - Configuration of Twig via FTP with Autoloader.php -
i try twig work in application.
so, i've unpacked , uploaded twig files on ftp in twig
folder.
i've created in twig_templates
folder template base.twig
looking this:
<!doctype html> <html lang="pl"> <head> <title>{{title}}</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <div id="content-container"> <{{type}} id="content"> {% block content %} {% endblock %} </{{type}}> </div> </body> </html>
and i've tried use template in base.php
file (deployed in project root folder):
<?php require_once '/twig/lib/twig/autoloader.php'; twig_autoloader::register(); $loader = new twig_loader_filesystem('/twig_templates'); $twig = new twig_environment($loader, array( 'cache' => '/twig_templates/cache') ); $template = $twig->loadtemplate('base.twig'); echo $template->render(array (title=>"title", type=>"article")); ?>
i'm unable work , have no idea why. i've tried both .twig
, .html
files doesn't seem making difference. code seems fine (to me), maybe it's twig configuration?
Comments
Post a Comment