|
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 |
dubhunter Smarty Rookie
Joined: 09 Aug 2007 Posts: 13 Location: Santa Monica, CA
|
Posted: Sat Nov 17, 2007 3:33 am Post subject: Inline concatenation for function args and mybe more |
|
|
I have searched and searched through the docs, and I cannot seem to solve this problem.
So I'm trying to pass a concatenated string to a smarty function in a loop like this:
Code: |
{foreach from=$item item=i}
<h1>{$i.name}</h1>
<a href="{dbduri replace=$page_url action='edit' params='id,$i.id'}">Edit</a>
{/foreach}
|
But it either will not dereference $i.id, or it gives me 'Array.id' when I try '.' or '+'.
Is there something I am missing?
I would really love it to work like this...
Code: |
{function arg='str'.$foo}
|
...or something to that effect. Hope my examples make sense. _________________ http://dontblinkdesign.com |
|
Back to top |
|
Celeb Administrator
Joined: 17 Apr 2007 Posts: 1025 Location: Vienna
|
|
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
|