
23.03.2010, 21:53
|
|
Участник форума
Регистрация: 07.08.2008
Сообщений: 281
С нами:
9347610
Репутация:
165
|
|
Сообщение от m0Hze
PHP код:
$tpl->load_template('main.tpl');
Больше чем уверен, что там происходит обычный file_get_contents('main.tpl');
Так вот, почему тогда там должно выполниться то,что ты там написал?)
Оно выполняется уже познее, при eval'е.Поэтому ты и видиш результат работы в фигурных скобках.
А как тогда с этим бороться?
class скручен с DLE
PHP код:
public function load_template($tpl_name) {
$time_before = $this->get_real_time();
if ($tpl_name == '' || !file_exists($this->dir . DIRECTORY_SEPARATOR . $tpl_name)) { die ("Невозможно загрузить шаблон: ". $tpl_name); return false;}
$this->template = file_get_contents($this->dir . DIRECTORY_SEPARATOR . $tpl_name);
if ( stristr( $this->template, "{include file=" ) ) {
$this->template = preg_replace( "#\\{include file=['\"](.+?)['\"]\\}#ies","\$this->sub_load_template('\\1')", $this->template);
}
$this->copy_template = $this->template;
$this->template_parse_time += $this->get_real_time() - $time_before;
return true;
}
|
|
|