mirror of
https://github.com/smarty-php/smarty.git
synced 2026-05-05 20:24:18 +02:00
fix code frame of inline (merged) subtemplate
This commit is contained in:
@@ -73,4 +73,19 @@ class Smarty_Internal_Extension_CodeFrame
|
||||
$output .= "<?php }\n}\n?>";
|
||||
return $output;
|
||||
}
|
||||
|
||||
public static function createFunctionFrame(Smarty_Internal_Template $_template, $content = '')
|
||||
{
|
||||
if (!isset($_template->properties['unifunc'])) {
|
||||
$_template->properties['unifunc'] = 'content_' . str_replace(array('.', ','), '_', uniqid('', true));
|
||||
}
|
||||
$output = "<?php\n";
|
||||
$output .= "/*%%SmartyHeaderCode:{$_template->properties['nocache_hash']}%%*/\n";
|
||||
$output .= "function {$_template->properties['unifunc']} (\$_smarty_tpl) {\n";
|
||||
$output .= "?>\n" . $content;
|
||||
$output .= "<?php\n";
|
||||
$output .= "/*/%%SmartyNocache:{$_template->properties['nocache_hash']}%%*/\n";
|
||||
$output .= "}\n?>";
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user