PEEL Shopping
Open source ecommerce : PEEL Shopping
smarty_internal_compile_config_load.php
Go to the documentation of this file.
1 <?php
19 
26  public $required_attributes = array('file');
33  public $shorttag_order = array('file','section');
40  public $optional_attributes = array('section', 'scope');
41 
49  public function compile($args, $compiler)
50  {
51  static $_is_legal_scope = array('local' => true,'parent' => true,'root' => true,'global' => true);
52  // check and get attributes
53  $_attr = $this->getAttributes($compiler, $args);
54 
55  if ($_attr['nocache'] === true) {
56  $compiler->trigger_template_error('nocache option not allowed', $compiler->lex->taglineno);
57  }
58 
59 
60  // save posible attributes
61  $conf_file = $_attr['file'];
62  if (isset($_attr['section'])) {
63  $section = $_attr['section'];
64  } else {
65  $section = 'null';
66  }
67  $scope = 'local';
68  // scope setup
69  if (isset($_attr['scope'])) {
70  $_attr['scope'] = trim($_attr['scope'], "'\"");
71  if (isset($_is_legal_scope[$_attr['scope']])) {
72  $scope = $_attr['scope'];
73  } else {
74  $compiler->trigger_template_error('illegal value for "scope" attribute', $compiler->lex->taglineno);
75  }
76  }
77  // create config object
78  $_output = "<?php \$_config = new Smarty_Internal_Config($conf_file, \$_smarty_tpl->smarty, \$_smarty_tpl);";
79  $_output .= "\$_config->loadConfigVars($section, '$scope'); ?>";
80  return $_output;
81  }
82 
83 }
84 
85 ?>
getAttributes($compiler, $attributes)
This function checks if the attributes passed are valid.
compile($args, $compiler)
Compiles code for the {config_load} tag.

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.