Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
Dedicated server web hosting provided by Guru-host.eu.
How to replace string with tpl ?

 
Post new topic   Reply to topic    Smarty Forum Index -> Smarty Development
View previous topic :: View next topic  
Author Message
visaolaithe
Smarty n00b


Joined: 06 Oct 2011
Posts: 3

PostPosted: Tue Oct 11, 2011 7:59 am    Post subject: How to replace string with tpl ? Reply with quote

I have a string as $str, and a php function as make_string($str) to edit this string .
How can i show that string ?
p/s

{$str=mystring}
{$str|make_string}
is not correct.
Can somebody help me?
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 4200
Location: Hamburg / Germany

PostPosted: Tue Oct 11, 2011 10:13 am    Post subject: Reply with quote

I assume that you are using Smarty3.

In this case {$str|make_string} or {make_string($str)} should work.
Back to top
View user's profile Send private message
mohrt
Administrator


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

PostPosted: Tue Oct 11, 2011 1:58 pm    Post subject: Reply with quote

In Smarty 2, register your function as a modifier.
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 Development 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