Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Short way to use constants in Smarty3

 
Post new topic   Reply to topic    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: 7366
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:   
Post new topic   Reply to topic    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