libs/sysplugins/smarty_template_config.php Quellcode

smarty_template_config.php
gehe zur Dokumentation dieser Datei
1 <?php
23 {
29  public $compiler_class = 'Smarty_Internal_Config_File_Compiler';
30 
36  public $template_lexer_class = 'Smarty_Internal_Configfilelexer';
37 
43  public $template_parser_class = 'Smarty_Internal_Configfileparser';
44 
50  public $config_sections = null;
51 
57  public $scope = 'local';
58 
64  public $isConfig = true;
65 
76  {
77  $this->handler = clone $handler; // Note: prone to circular references
78  $this->resource = $resource;
79  $this->type = $type;
80  $this->name = $name;
81  $this->smarty = $smarty;
82  }
83 
95  public static function load(Smarty_Internal_Template $_template = null, Smarty $smarty = null, $template_resource = null)
96  {
97  static $_incompatible_resources = array('extends' => true, 'php' => true);
98  $smarty = $_template->smarty;
99  $template_resource = $_template->template_resource;
100  if (empty($template_resource)) {
101  throw new SmartyException('Missing config name');
102  }
103  // parse resource_name, load resource handler
104  list($name, $type) = Smarty_Resource::parseResourceName($template_resource, $smarty->default_config_type);
105  // make sure configs are not loaded via anything smarty can't handle
106  if (isset($_incompatible_resources[$type])) {
107  throw new SmartyException ("Unable to use resource '{$type}' for config");
108  }
110  $source = new Smarty_Template_Config($resource, $smarty, $template_resource, $type, $name);
111  $resource->populate($source, $_template);
112  if ((!isset($source->exists) || !$source->exists) && isset($_template->smarty->default_config_handler_func)) {
114  }
115  $source->unique_resource = $resource->buildUniqueResourceName($smarty, $name, true);
116  return $source;
117  }
118 }




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.