Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

QUESTION: Using variable name as string

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


Joined: 27 Sep 2010
Posts: 3

PostPosted: Mon Sep 27, 2010 11:02 pm    Post subject: QUESTION: Using variable name as string Reply with quote

I've read faq, was searchin forum. but didn't found a solution

The problem is

i have a foreach, and another foreachES inside the first one.
i've assigned arrays to "foreaching" inner selectors, but they have names like $selector_type5, $selector_type7 etc.

{$item.type} in parent foreach contains type of selector, but i can't place it to the "from" in inner foreaches.

Is the way out exists?

Code:

{foreach key=key item=item from=$anywherefields}
  {$item.name}
  {$item.type}

  {foreach key=key item=sele from=$selector_$item.type}
  <option value="{$sele.id}">{$sele.title}</option>
  {/foreach}

{/foreach}


Thx a lot!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> General 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