-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathexample2.php
More file actions
executable file
·14 lines (12 loc) · 869 Bytes
/
example2.php
File metadata and controls
executable file
·14 lines (12 loc) · 869 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php
define ( 'VTPL_DEBUG', true);//on debug templates are always recompiled and the console visible, useful for development
define ( 'PATH', dirname(__FILE__));
require_once('view.php');
$view = View :: get_instance();
$view->title = 'Vtpl example 2';
$view->products = array(
1 => array('title'=> 'Product 1', 'img' => 'https://loremflickr.com/640/360?' . rand() /*'/img/products/1.jpg'*/ , 'description' => 'the best product ever', 'price' => '$10'),
2 => array('title'=> 'Product 2', 'img' => 'https://loremflickr.com/640/360?' . rand() /*'/img/products/2.jpg'*/ , 'description' => 'the second best product ever', 'price' => '$30'),
3 => array('title'=> 'Product 3', 'img' => 'https://loremflickr.com/640/360?' . rand() /*'/img/products/3.jpg'*/ , 'description' => 'the third best product ever', 'price' => '$50')
);
$view->render('example2.html');