Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Inline concatenation for function args and mybe more

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Feature Requests
View previous topic :: View next topic  
Author Message
dubhunter
Smarty Rookie


Joined: 09 Aug 2007
Posts: 13
Location: Santa Monica, CA

PostPosted: Sat Nov 17, 2007 3:33 am    Post subject: Inline concatenation for function args and mybe more Reply with quote

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
View user's profile Send private message Visit poster's website
Celeb
Administrator


Joined: 17 Apr 2007
Posts: 1025
Location: Vienna

PostPosted: Sat Nov 17, 2007 10:40 am    Post subject: Reply with quote

Code:
<a href="{dbduri replace=$page_url action='edit' params="id,`$i.id`"}">


http://smarty.php.net/manual/en/language.syntax.quotes.php
_________________
Darn computers always do what I tell them to instead of what I want them to do.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Feature Requests 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