-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
28 lines (22 loc) · 859 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
require_once 'vendor/autoload.php';
require_once 'inc/utils.php';
$loader = new Twig_Loader_Filesystem([
'assets/dist',
'templates',
]);
$twig = new Twig_Environment($loader);
$twig->addFunction(new Twig_Function('asset', 'Utils::get_asset_path'));
$twig->addFunction(new Twig_Function('image', 'Utils::get_image_path'));
$twig->addFunction(new Twig_Function('svg', 'Utils::embed_svg'));
$twig->addFilter(new Twig_Filter('slugify', 'Utils::slugify'));
$twig->addFilter(new Twig_Filter('char_limit', 'Utils::char_limit'));
$twig->addFilter(new Twig_Filter('word_limit', 'Utils::word_limit'));
$twig->addFilter(new Twig_Filter('relative_timestamp', 'Utils::relative_timestamp'));
$template = $twig->load('page-home.twig');
echo $template->render([
'site' => [
'name' => 'Vue Twig Scaffold',
'url' => 'http://localhost:8000/',
],
]);