|
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 |
bordeux Smarty Rookie
Joined: 27 Jul 2010 Posts: 10
|
Posted: Mon Dec 27, 2010 11:41 pm Post subject: {cache}/{static} section |
|
|
Why there is no section {cache} (or {static})?
example:
Code: |
<?php
require('Smarty.class.php');
$smarty = new Smarty;
// uses the value of $smarty->cacheLifetime() to determine
// the number of seconds a cache is good for
$smarty->setCaching(false);
$smarty->assign("test", "example text");
$smarty->display('index.tpl');
?>
|
index.tpl:
Code: |
<html>
<body>
{$test}
{cache}
{$test}
{/cache}
</body>
</html>
|
Result - compiled template ecc2be3e3e407f80ae0a0c93f5cac3380423632a.file.index.tpl
Code: | <html>
<body>
<?php echo $_smarty_tpl->getVariable('test')->value;?>
example text
</body>
</html>
|
I am still not knowing English well, so I preferred it this way to show - programming. I hope that it is obvious what it is about.
PS.
Or
{$test static}/{$test cache} {* short-hand *} |
|
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
|