gehe zur Dokumentation dieser Datei
29 public function compile($args, $compiler, $parameter)
33 $output = $parameter[
'value'];
35 foreach ($parameter[
'modifierlist'] as $single_modifier) {
36 $modifier = $single_modifier[0];
37 $single_modifier[0] = $output;
38 $params = implode(
',', $single_modifier);
40 if (isset($compiler->known_modifier_type[$modifier])) {
41 $modifier_types = array($compiler->known_modifier_type[$modifier]);
43 $modifier_types = array(1, 2, 3, 4, 5, 6);
45 foreach ($modifier_types as $type) {
51 if (!is_array($function)) {
52 $output =
"{$function}({$params})";
54 if (is_object($function[0])) {
55 $output =
'$_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER][\'' . $modifier .
'\'][0][0]->
' . $function[1] . '(
' . $params . ')
';
57 $output = $function[0] . '::
' . $function[1] . '(
' . $params . ')
';
60 $compiler->known_modifier_type[$modifier] = $type;
65 // registered modifier compiler
66 if (isset($compiler->smarty->registered_plugins[Smarty::PLUGIN_MODIFIERCOMPILER][$modifier][0])) {
67 $output = call_user_func($compiler->smarty->registered_plugins[Smarty::PLUGIN_MODIFIERCOMPILER][$modifier][0], $single_modifier, $compiler->smarty);
68 $compiler->known_modifier_type[$modifier] = $type;
73 // modifiercompiler plugin
74 if ($compiler->smarty->loadPlugin('smarty_modifiercompiler_
' . $modifier)) {
75 // check if modifier allowed
76 if (!is_object($compiler->smarty->security_policy) || $compiler->smarty->security_policy->isTrustedModifier($modifier, $compiler)) {
77 $plugin = 'smarty_modifiercompiler_
' . $modifier;
78 $output = $plugin($single_modifier, $compiler);
80 $compiler->known_modifier_type[$modifier] = $type;
86 if ($function = $compiler->getPlugin($modifier, Smarty::PLUGIN_MODIFIER)) {
87 // check if modifier allowed
88 if (!is_object($compiler->smarty->security_policy) || $compiler->smarty->security_policy->isTrustedModifier($modifier, $compiler)) {
89 $output = "{$function}({$params})";
91 $compiler->known_modifier_type[$modifier] = $type;
97 if (is_callable($modifier)) {
98 // check if modifier allowed
99 if (!is_object($compiler->smarty->security_policy) || $compiler->smarty->security_policy->isTrustedPhpModifier($modifier, $compiler)) {
100 $output = "{$modifier}({$params})";
102 $compiler->known_modifier_type[$modifier] = $type;
107 // default plugin handler
108 if (isset($compiler->default_handler_plugins[Smarty::PLUGIN_MODIFIER][$modifier]) || (is_callable($compiler->smarty->default_plugin_handler_func) && $compiler->getPluginFromDefaultHandler($modifier, Smarty::PLUGIN_MODIFIER))) {
109 $function = $compiler->default_handler_plugins[Smarty::PLUGIN_MODIFIER][$modifier][0];
110 // check if modifier allowed
111 if (!is_object($compiler->smarty->security_policy) || $compiler->smarty->security_policy->isTrustedModifier($modifier, $compiler)) {
112 if (!is_array($function)) {
113 $output = "{$function}({$params})";
115 if (is_object($function[0])) {
116 $output = '$_smarty_tpl->smarty->registered_plugins[
Smarty::PLUGIN_MODIFIER][\
'' . $modifier .
'\'][0][0]->
' . $function[1] . '(
' . $params . ')
';
118 $output = $function[0] . '::
' . $function[1] . '(
' . $params . ')
';
122 if (isset($compiler->template->required_plugins['nocache
'][$modifier][Smarty::PLUGIN_MODIFIER]['file
']) || isset($compiler->template->required_plugins['compiled
'][$modifier][Smarty::PLUGIN_MODIFIER]['file
'])) {
124 $compiler->known_modifier_type[$modifier] = 4;
126 $compiler->known_modifier_type[$modifier] = $type;
132 if (!isset($compiler->known_modifier_type[$modifier])) {
133 $compiler->trigger_template_error("unknown modifier \"" . $modifier . "\"", $compiler->lex->taglineno);
Sie sind hier: Home » MyOOS Benutzerhandbuch » Smarty
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.