Re: Stupid array question : precision

From: Date: Sat, 18 Aug 2001 16:16:48 +0000
Subject: Re: Stupid array question : precision
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-1359@lists.php.net to get a copy of this message
Mike, You're right, but for a reason I fail to find out with data the result is exactly the same I get displayed $myarray[1] and .. that's all.. apparently the loop is donne through $array[1] and doesn't reach $array[2]...$array[n] Its why I tried to use the index So to ask my question in another way What is the right section code to display an array of the form Array (
    [1] => Array
        (
            [paragraph_id] =>
            [paragraph_title] => foo tile
            [paragraph_chapo] => foo chapo
            [paragraph_text] =>  foo text
        )
    [2] => Array
        (
            [paragraph_id] => 2
            [paragraph_title] => foo title
            [paragraph_chapo] => foo chapo
            [paragraph_text] => foo text
        )
    [n] => Array
        (
            [paragraph_id] => n
            [paragraph_title] => foo title
            [paragraph_chapo] => foo chapo
            [paragraph_text] => foo text
        )
) Luc At 18:11 18/08/01 +0200, Mike Krus wrote:
Luc Saint-Elie wrote:
{section name=data loop=$article_corps} {$article_corps[data.index].paragraph_id} {$article_corps[data.index].paragraph_title} {$article_corps[data.index].paragraph_chapo} {$article_corps[data.index].paragraph_text} {/section}
shouldn't it be: {section name=data loop=$article_corps} {$article_corps[data].paragraph_id} {$article_corps[data].paragraph_title} {$article_corps[data].paragraph_chapo} {$article_corps[data].paragraph_text} {/section} the 'data.index' syntax is to print the index value... Mike


« previous php.smarty.general (#1359) next »