libs/sysplugins/smarty_internal_compile_call.php Quellcode

smarty_internal_compile_call.php
gehe zur Dokumentation dieser Datei
1 <?php
18 {
25  public $required_attributes = array('name');
32  public $shorttag_order = array('name');
39  public $optional_attributes = array('_any');
40 
49  public function compile($args, $compiler)
50  {
51  // check and get attributes
52  $_attr = $this->getAttributes($compiler, $args);
53  // save possible attributes
54  if (isset($_attr['assign'])) {
55  // output will be stored in a smarty variable instead of being displayed
56  $_assign = $_attr['assign'];
57  }
58  //$_name = trim($_attr['name'], "'\"");
59  $_name = $_attr['name'];
60  unset($_attr['name'], $_attr['assign'], $_attr['nocache']);
61  // set flag (compiled code of {function} must be included in cache file
62  if (!$compiler->template->caching || $compiler->nocache || $compiler->tag_nocache) {
63  $_nocache = 'true';
64  } else {
65  $_nocache = 'false';
66  }
67  $_paramsArray = array();
68  foreach ($_attr as $_key => $_value) {
69  if (is_int($_key)) {
70  $_paramsArray[] = "$_key=>$_value";
71  } else {
72  $_paramsArray[] = "'$_key'=>$_value";
73  }
74  }
75  $_params = 'array(' . implode(",", $_paramsArray) . ')';
76  //$compiler->suppressNocacheProcessing = true;
77  // was there an assign attribute
78  if (isset($_assign)) {
79  $_output = "<?php ob_start();\$_smarty_tpl->callTemplateFunction ({$_name}, \$_smarty_tpl, {$_params}, {$_nocache}); \$_smarty_tpl->assign({$_assign}, ob_get_clean());?>\n";
80  } else {
81  $_output = "<?php \$_smarty_tpl->callTemplateFunction ({$_name}, \$_smarty_tpl, {$_params}, {$_nocache});?>\n";
82  }
83  return $_output;
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.