libs/sysplugins/smarty_internal_filter_handler.php Quellcode

smarty_internal_filter_handler.php
gehe zur Dokumentation dieser Datei
1 <?php
18 {
33  public static function runFilter($type, $content, Smarty_Internal_Template $template)
34  {
35  $output = $content;
36  // loop over autoload filters of specified type
37  if (!empty($template->smarty->autoload_filters[$type])) {
38  foreach ((array) $template->smarty->autoload_filters[$type] as $name) {
39  $plugin_name = "Smarty_{$type}filter_{$name}";
40  if ($template->smarty->loadPlugin($plugin_name)) {
41  if (function_exists($plugin_name)) {
42  // use loaded Smarty2 style plugin
43  $output = $plugin_name($output, $template);
44  } elseif (class_exists($plugin_name, false)) {
45  // loaded class of filter plugin
46  $output = call_user_func(array($plugin_name, 'execute'), $output, $template);
47  }
48  } else {
49  // nothing found, throw exception
50  throw new SmartyException("Unable to load filter {$plugin_name}");
51  }
52  }
53  }
54  // loop over registerd filters of specified type
55  if (!empty($template->smarty->registered_filters[$type])) {
56  foreach ($template->smarty->registered_filters[$type] as $key => $name) {
57  if (is_array($template->smarty->registered_filters[$type][$key])) {
58  $output = call_user_func($template->smarty->registered_filters[$type][$key], $output, $template);
59  } else {
60  $output = $template->smarty->registered_filters[$type][$key]($output, $template);
61  }
62  }
63  }
64  // return filtered output
65  return $output;
66  }
67 }




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.