libs/sysplugins/smarty_internal_extension_defaulttemplatehandler.php Quellcode

smarty_internal_extension_defaulttemplatehandler.php
gehe zur Dokumentation dieser Datei
1 <?php
18 {
19 
27  static function _getDefault(Smarty_Internal_Template $_template, &$source, &$resObj)
28  {
29  if ($source->isConfig) {
30  $default_handler = $_template->smarty->default_config_handler_func;
31  } else {
32  $default_handler = $_template->smarty->default_template_handler_func;
33  }
34  $_content = $_timestamp = null;
35  $_return = call_user_func_array($default_handler,
36  array($source->type, $source->name, &$_content, &$_timestamp, $source->smarty));
37  if (is_string($_return)) {
38  $source->exists = is_file($_return);
39  if ($source->exists) {
40  $source->timestamp = filemtime($_return);
41  }
42  $source->filepath = $_return;
43  } elseif ($_return === true) {
44  $source->content = $_content;
45  $source->timestamp = $_timestamp;
46  $source->exists = true;
47  $source->recompiled = true;
48  $source->filepath = false;
49  }
50  }
51 
60  static function registerDefaultTemplateHandler(Smarty $smarty, $callback)
61  {
62  if (is_callable($callback)) {
63  $smarty->default_template_handler_func = $callback;
64  } else {
65  throw new SmartyException("Default template handler not callable");
66  }
67  }
68 
77  static function registerDefaultConfigHandler(Smarty $smarty, $callback)
78  {
79  if (is_callable($callback)) {
80  $smarty->default_config_handler_func = $callback;
81  } else {
82  throw new SmartyException("Default config handler not callable");
83  }
84  }
85 }




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.