|
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 |
visaolaithe Smarty n00b
Joined: 06 Oct 2011 Posts: 3
|
Posted: Tue Oct 11, 2011 7:59 am Post subject: How to replace string with tpl ? |
|
|
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 |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Tue Oct 11, 2011 10:13 am Post subject: |
|
|
I assume that you are using Smarty3.
In this case {$str|make_string} or {make_string($str)} should work. |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Tue Oct 11, 2011 1:58 pm Post subject: |
|
|
In Smarty 2, register your function as a modifier. |
|
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
|