Re: [SMARTY] Re: Compile time

From: Date: Fri, 21 Feb 2003 00:20:35 +0000
Subject: Re: [SMARTY] Re: Compile time
References: 1 2 3 4 5  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-8069@lists.php.net to get a copy of this message
On Thu, 20 Feb 2003 16:45:33 -0700, Darryl Bleau wrote: > Would it be possible at all to include a Smarty variable in a later > release that allows you to access the compile time of the template? > Seems like everyone wants to do this, might be nice to have a consistent > way of doing it. Something like "{SmartyCompileTime}", which would > return in date (so you could format it as you pleased) format the exact > (or as close as you can get) time it took from the beginning of > compiling the template to the end. I need more than compile time, since I need to display the number of mySQL queries used to create the document, hmmm.... why can't we just have a function myFunction(&$smarty) { $smart->assign('this','that'); // etc.. } $smarty->set_compile_function('myFunction'); Which would define *one* function that would be run on compile time, just before creating the final output ( $smarty->display() ) Although an ExecTime function would be usefull as well, returning the time in microseconds, but you would STILL have to be able to use this variable, so I think defining a function to be called might be the best :) -- Tom Sommer, denmark www.tsn.dk - www.dreamcoder.dk

« previous php.smarty.general (#8069) next »