PEEL Shopping
Open source ecommerce : PEEL Shopping
EngineTpl.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: EngineTpl.php 46935 2015-09-18 08:49:48Z gboussin $
14 if (!defined('IN_PEEL')) {
15  die();
16 }
17 
28 abstract class EngineTpl {
29  private $name;
30  private $create_time;
40  public static function create($type, $templadeDir, $forceCompile = false, $debugging = false)
41  {
42  switch ($type) {
43  case 'smarty':
44  require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'SmartyEngine.php';
45  $e = new SmartyEngine($templadeDir, $forceCompile, $debugging);
46  $e->name = $type;
47  return $e;
48 
49  case 'twig':
50  require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'TwigEngine.php';
51  $e = new TwigEngine($templadeDir, $forceCompile, $debugging);
52  $e->name = $type;
53  return $e;
54  }
55  }
56 
62  final public function getName()
63  {
64  return $this->name;
65  }
66 
74  abstract public function assign($tpl_var, $value = null);
75 
81  abstract public function display($template);
82 
89  abstract public function fetch($template);
90 
98  abstract public function createTemplate($template, array $data = null);
99 }
100 
foreach(array('date1', 'date2', 'type', 'renewals', 'width') as $item) $data
Definition: chart-data.php:29
static create($type, $templadeDir, $forceCompile=false, $debugging=false)
Creates EngineTpl adapter of specified type.
Definition: EngineTpl.php:40
fetch($template)
fetches a rendered template and returns the outoput
createTemplate($template, array $data=null)
This creates a template object which later can be rendered by the display or fetch.
assign($tpl_var, $value=null)
assigns global Template variable(s)
display($template)
displays a Template
getName()
Returns created adapter type name.
Definition: EngineTpl.php:62

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