|
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 |
Sybux2000 Smarty Rookie
Joined: 27 Feb 2005 Posts: 13
|
Posted: Tue Nov 24, 2009 9:16 pm Post subject: Creating a little function for a template |
|
|
Hi,
I'm using the great upcoming smarty 3 B5
I'd like to display some simple red or green flag depending on the state of a value.
As I've got many values to display, I'd like to know if I can write a little function in the TPL file which will receive a value and then display the good flag.
Thx in advance. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Tue Nov 24, 2009 9:37 pm Post subject: |
|
|
You can write a modifier plugin which checks the variable value and returns corresponding code for the flag.
See Smarty2 documentation how to write modifiers. |
|
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
|