libs/sysplugins/smarty_internal_compile_private_function_plugin.php Quellcode

smarty_internal_compile_private_function_plugin.php
gehe zur Dokumentation dieser Datei
1 <?php
18 {
25  public $required_attributes = array();
32  public $optional_attributes = array('_any');
33 
45  public function compile($args, $compiler, $parameter, $tag, $function)
46  {
47  // This tag does create output
48  $compiler->has_output = true;
49 
50  // check and get attributes
51  $_attr = $this->getAttributes($compiler, $args);
52  if ($_attr['nocache'] === true) {
53  $compiler->tag_nocache = true;
54  }
55  unset($_attr['nocache']);
56  // convert attributes into parameter array string
57  $_paramsArray = array();
58  foreach ($_attr as $_key => $_value) {
59  if (is_int($_key)) {
60  $_paramsArray[] = "$_key=>$_value";
61  } else {
62  $_paramsArray[] = "'$_key'=>$_value";
63  }
64  }
65  $_params = 'array(' . implode(",", $_paramsArray) . ')';
66  // compile code
67  $output = "<?php echo {$function}({$_params},\$_smarty_tpl);?>\n";
68 
69  return $output;
70  }
71 }




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.