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

Foreach Schleifen Problem

 
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 -> Language: German
View previous topic :: View next topic  
Author Message
karabey
Smarty n00b


Joined: 11 Jul 2013
Posts: 2

PostPosted: Thu Jul 11, 2013 2:50 pm    Post subject: Foreach Schleifen Problem Reply with quote

Hallo,

Ich versuche eine Foreach Schleife in Smarty umzuschreiben. Leider ohne Erfolg.

Der PHP Code
Code:
<ul>
<?php foreach ($feed['items'] as $item): ?>
    <li>
        <a href="<?= $item['link']; ?>"><?= $item['title']; ?></a>
    </li>
<?php endforeach; ?>
</ul>


Mein umgeschriebener Smarty Code
Code:
{foreach $feed['items'] as $item}
    <li>
        <a href="{php}$item['link']{/php}">{php}$item['title']{/php}</a>
    </li>
{/foreach}


Würde mich über Hilfe sehr freuen. Danke
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Thu Jul 11, 2013 7:22 pm    Post subject: Reply with quote

Siehe http://www.smarty.net/docs/en/language.syntax.variables.tpl

Code:
{foreach $feed['items'] as $item}
    <li>
        <a href="{$item['link']}">{$item['title']}</a>
    </li>
{/foreach}
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 -> Language: German 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