|
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 |
Orpheus Smarty n00b
Joined: 28 Oct 2009 Posts: 3
|
Posted: Wed Oct 28, 2009 1:22 pm Post subject: Call a php function within Smarty unserialize |
|
|
Hello,
Would it be possible to call a built-in function from PHP (unserialize) within a Smarty template ?
Indeed, i gather data from atable and one field is serialized and i would like to unserialize it, to display it clearly....
I think this is the more appropriate way and i assume that Smarty allows to call built-in functions.
Thanks a lot ! |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Wed Oct 28, 2009 4:07 pm Post subject: |
|
|
try:
{$foo|unserialize} |
|
Back to top |
|
Orpheus Smarty n00b
Joined: 28 Oct 2009 Posts: 3
|
Posted: Thu Oct 29, 2009 8:33 am Post subject: |
|
|
How is it possible to see all elements contained?
{foreach from =$foo|unserialize item=job}
{job.Element1}
{job.Element2}
? |
|
Back to top |
|
Orpheus Smarty n00b
Joined: 28 Oct 2009 Posts: 3
|
Posted: Thu Oct 29, 2009 9:52 am Post subject: |
|
|
Thank you very much mohrt !
i've finally achieved to obtain what i expected
Thanks a lot !!! |
|
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
|