-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.php
More file actions
36 lines (30 loc) · 996 Bytes
/
example.php
File metadata and controls
36 lines (30 loc) · 996 Bytes
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
29
30
31
32
33
34
35
36
<?php
// формируем массив
$nav = array(
'primary' => array(
array('name' => 'Clothes', 'url' => '/clothes'),
array('name' => 'Shoes and Accessories', 'url' => '/accessories'),
array('name' => 'Toys and Gadgets', 'url' => '/toys'),
array('name' => 'Books and Movies', 'url' => '/media'),
),
'secondary' => array(
array('name' => 'By Price', 'url' => '/selector/v328ebs'),
array('name' => 'By Brand', 'url' => '/selector/gf843k2b'),
array('name' => 'By Interest', 'url' => '/selector/t31h393'),
array('name' => 'By Recommendation', 'url' => '/selector/gf942hb')
)
);
include 'Twig/Autoloader.php';
Twig_Autoloader::register();
try {
$loader = new Twig_Loader_Filesystem('templates');
$twig = new Twig_Environment($loader);
$template = $twig->loadTemplate('shop.tmpl');
echo $template->render(array (
'nav' => $nav,
'updated' => '24 Jan 2011'
));
} catch (Exception $e) {
die ('ERROR: ' . $e->getMessage());
}
?>