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

Short way to use constants in Smarty3

 
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 -> Smarty 3
View previous topic :: View next topic  
Author Message
nielsNL
Smarty Rookie


Joined: 03 May 2009
Posts: 17

PostPosted: Tue Oct 27, 2009 10:24 am    Post subject: Short way to use constants in Smarty3 Reply with quote

Hello,

In our Fusion Ticket project we use now a hacked version of smarty2.6.
This hack helps us to use constants more easier then the Smarty.const.<constname>

For this we introduced the type !<constname>!, this was a wrong choice but it works. Now we like to move to Smarty3 and like the same possibility in Smarty3. Can you please help us with this or add it natively in Smarty3?

Our thanks is greet.

Greetings
Niels v/d Spek
Team Fusion Ticket.
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Tue Oct 27, 2009 9:14 pm    Post subject: Reply with quote

No hacks necessary, use a prefilter:

search:

!FOO!

replace:

{$smarty.const.FOO}
Back to top
View user's profile Send private message Visit poster's website
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 -> Smarty 3 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