|
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 |
screenmates Smarty Rookie
Joined: 04 Oct 2006 Posts: 14
|
Posted: Mon Jun 25, 2007 10:40 am Post subject: Function to go into an {if} tag |
|
|
Hi All,
I have to write a tag {cache id=...} that needs to be called in a if-statement inside templates, like so:
if ( ! cache->start())
{
// output content to cache...
$cache->end();
}
// output not cached...
I wrote the cache() and endcache() functions and registered them with smarty. But how do I include them in a if-tag, like so?
{if ! cache id=abc}
// output content to cache...
{endcache}
{/if}
The above does not work and gives an error:
Error: 256
Text : Smarty error: [in Header.tpl line 1]: syntax error: unidentified token '=' (Smarty_Compiler.class.php, line 1391)
File : \Library\Smarty\Smarty.class.php
Line : 1095
Is there anyother way I can include my function in a if-statement tag as mentioned above? I'm afraid I'm missing something terribly simple
TIA |
|
Back to top |
|
screenmates Smarty Rookie
Joined: 04 Oct 2006 Posts: 14
|
Posted: Mon Jun 25, 2007 11:17 am Post subject: |
|
|
Never mind; I figured it out. |
|
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
|