Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

{cache}/{static} section

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Plugins
View previous topic :: View next topic  
Author Message
bordeux
Smarty Rookie


Joined: 27 Jul 2010
Posts: 10

PostPosted: Mon Dec 27, 2010 11:41 pm    Post subject: {cache}/{static} section Reply with quote

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
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Plugins All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP