libs/sysplugins/smarty_internal_compile_config_load.php Quellcode

smarty_internal_compile_config_load.php
gehe zur Dokumentation dieser Datei
1 <?php
18 {
25  public $required_attributes = array('file');
32  public $shorttag_order = array('file', 'section');
39  public $optional_attributes = array('section', 'scope');
40 
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  // save possible attributes
60  $conf_file = $_attr['file'];
61  if (isset($_attr['section'])) {
62  $section = $_attr['section'];
63  } else {
64  $section = 'null';
65  }
66  $scope = 'local';
67  // scope setup
68  if (isset($_attr['scope'])) {
69  $_attr['scope'] = trim($_attr['scope'], "'\"");
70  if (isset($_is_legal_scope[$_attr['scope']])) {
71  $scope = $_attr['scope'];
72  } else {
73  $compiler->trigger_template_error('illegal value for "scope" attribute', $compiler->lex->taglineno);
74  }
75  }
76  // create config object
77  $_output = "<?php Smarty_Internal_Extension_Config::configLoad(\$_smarty_tpl, $conf_file, $section, '$scope');?>";
78 
79  return $_output;
80  }
81 }




Korrekturen, Hinweise und Ergänzungen

Bitte scheuen Sie sich nicht und melden Sie, was auf dieser Seite sachlich falsch oder irreführend ist, was ergänzt werden sollte, was fehlt usw. Dazu bitte oben aus dem Menü Seite den Eintrag Support Forum wählen. Es ist eine kostenlose Anmeldung erforderlich, um Anmerkungen zu posten. Unpassende Postings, Spam usw. werden kommentarlos entfernt.