PEEL Shopping
Open source ecommerce : PEEL Shopping
smarty_internal_compile_eval.php
Go to the documentation of this file.
1 <?php
19 
26  public $required_attributes = array('var');
33  public $optional_attributes = array('assign');
40  public $shorttag_order = array('var','assign');
41 
49  public function compile($args, $compiler)
50  {
51  $this->required_attributes = array('var');
52  $this->optional_attributes = array('assign');
53  // check and get attributes
54  $_attr = $this->getAttributes($compiler, $args);
55  if (isset($_attr['assign'])) {
56  // output will be stored in a smarty variable instead of beind displayed
57  $_assign = $_attr['assign'];
58  }
59 
60  // create template object
61  $_output = "\$_template = new {$compiler->smarty->template_class}('eval:'.".$_attr['var'].", \$_smarty_tpl->smarty, \$_smarty_tpl);";
62  //was there an assign attribute?
63  if (isset($_assign)) {
64  $_output .= "\$_smarty_tpl->assign($_assign,\$_template->fetch());";
65  } else {
66  $_output .= "echo \$_template->fetch();";
67  }
68  return "<?php $_output ?>";
69  }
70 
71 }
72 
73 ?>
getAttributes($compiler, $attributes)
This function checks if the attributes passed are valid.
compile($args, $compiler)
Compiles code for the {eval} tag.

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