PEEL Shopping
Open source ecommerce : PEEL Shopping
TwigTemplate.php
Go to the documentation of this file.
1 <?php
2 // This file should be in UTF8 without BOM - Accents examples: éèê
3 // +----------------------------------------------------------------------+
4 // | Copyright (c) 2004-2015 Advisto SAS, service PEEL - contact@peel.fr |
5 // +----------------------------------------------------------------------+
6 // | This file is part of PEEL Shopping 8.0.0, which is subject to an |
7 // | opensource GPL license: you are allowed to customize the code |
8 // | for your own needs, but must keep your changes under GPL |
9 // | More information: https://www.peel.fr/lire/licence-gpl-70.html |
10 // +----------------------------------------------------------------------+
11 // | Author: Advisto SAS, RCS 479 205 452, France, https://www.peel.fr/ |
12 // +----------------------------------------------------------------------+
13 // $Id: TwigTemplate.php 46935 2015-09-18 08:49:48Z gboussin $
14 if (!defined('IN_PEEL')) {
15  die();
16 }
17 
18 require dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Template.php';
28 class TwigTemplate implements Template {
33  private $sit;
34  private $context = array();
35 
36  public function __construct($sit, $context)
37  {
38  $this->sit = $sit;
39  $this->context = $context;
40  }
41 
42  public function assign($tpl_var, $value = null)
43  {
44  $this->context[$tpl_var] = $value;
45  }
46 
47  public function display()
48  {
49  $this->sit->display($this->context);
50  }
51 
52  public function fetch()
53  {
54  //try {
55  return $this->sit->render($this->context);
56  //} catch (Twig_Error_Syntax $e) {
57  // return null;
58  //}
59  }
60 }
61 
assign($tpl_var, $value=null)
assigns Template variable(s)
fetch()
fetches a rendered template and returns the outoput
display()
displays a Template
__construct($sit, $context)

This documentation for Open ecommerce PEEL Shopping and PEEL.fr has been generated by Doxygen on Thu Oct 15 2015 14:41:19 - Peel ecommerce is a product of Agence web Advisto SAS. All rights reserved.