libs/plugins/shared.literal_compiler_param.php Quellcode

shared.literal_compiler_param.php
gehe zur Dokumentation dieser Datei
1 <?php
20 function smarty_literal_compiler_param($params, $index, $default = null)
21 {
22  // not set, go default
23  if (!isset($params[$index])) {
24  return $default;
25  }
26  // test if param is a literal
27  if (!preg_match('/^([\'"]?)[a-zA-Z0-9-]+(\\1)$/', $params[$index])) {
28  throw new SmartyException('$param[' . $index . '] is not a literal and is thus not evaluatable at compile time');
29  }
30 
31  $t = null;
32  eval("\$t = " . $params[$index] . ";");
33 
34  return $t;
35 }




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.