libs/sysplugins/smarty_internal_resource_php.php Quellcode

smarty_internal_resource_php.php
gehe zur Dokumentation dieser Datei
1 <?php
2 
13 {
19  public $uncompiled = true;
25  protected $short_open_tag;
26 
31  public function __construct()
32  {
33  $this->short_open_tag = ini_get('short_open_tag');
34  }
35 
44  public function getContent(Smarty_Template_Source $source)
45  {
46  if ($source->timestamp) {
47  return '';
48  }
49  throw new SmartyException("Unable to read template {$source->type} '{$source->name}'");
50  }
51 
61  public function renderUncompiled(Smarty_Template_Source $source, Smarty_Internal_Template $_template)
62  {
63  if (!$source->smarty->allow_php_templates) {
64  throw new SmartyException("PHP templates are disabled");
65  }
66  if (!$source->exists) {
67  if ($_template->parent instanceof Smarty_Internal_Template) {
68  $parent_resource = " in '{$_template->parent->template_resource}'";
69  } else {
70  $parent_resource = '';
71  }
72  throw new SmartyException("Unable to load template {$source->type} '{$source->name}'{$parent_resource}");
73  }
74 
75  // prepare variables
76  extract($_template->getTemplateVars());
77 
78  // include PHP template with short open tags enabled
79  ini_set('short_open_tag', '1');
83  $_smarty_template = $_template;
84  include($source->filepath);
85  ini_set('short_open_tag', $this->short_open_tag);
86  }
87 
95  {
96  $compiled->filepath = false;
97  $compiled->timestamp = false;
98  $compiled->exists = false;
99  }
100 }




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.