|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
lsemel Smarty Rookie
Joined: 18 Aug 2003 Posts: 5
|
Posted: Wed Sep 10, 2003 7:38 pm Post subject: Output template name for each template |
|
|
I want to output a comment
Code: | <!-- begin [name of template file] --> | and Code: | <!-- end [name of template file] --> | at the beginning and end of the output for each template.
Is there a way to do this with an output filter? I figured out how to do it with a postfilter, below:
Code: | /**
* Modifies generated template source code to add the name
* of the template file at the beginning and the end
*/
function common_addTemplateName($tpl_source,&$smarty) {
$current_file = $smarty->_current_file;
$compiled = '<? echo "\n<!-- begin ' . $current_file . ' -->\n"; ?> '
. $tpl_source
. '<? echo "\n<!-- end ' . $current_file . ' -->\n"; ?> ';
return $compiled;
} |
But I don't want this info compiled into the templates--I want to be able to turn it on and off without deleting all the compiled templates.
Thanks |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|