SMARTY : how to perform foreach in an array

Posted by user1020027 on Stack Overflow See other posts from Stack Overflow or by user1020027
Published on 2014-06-05T14:30:11Z Indexed on 2014/06/05 15:25 UTC
Read the original article Hit count: 140

Filed under:
|

I use smarty on a prestashop template.

this is the code I use

{Product::getProductCategoriesFull($product.id_product)}

It give me an array... with array inside. this is an exemple :

Array
(
[2] => Array
    (
        [id_category] => 2
        [name] => Accueil
        [link_rewrite] => home
    )

[7] => Array
    (
        [id_category] => 7
        [name] => Dancefloor
        [link_rewrite] => dancefloor
    )

[12] => Array
    (
        [id_category] => 12
        [name] => other
        [link_rewrite] => other
    )

)

I would like to find a way to get all the "link_rewrite" element : home,dancefloor,other.

It's possible with php, but the script is on a .tpl file. So How can I do this with smarty ?

Regards

© Stack Overflow or respective owner

Related posts about smarty

Related posts about prestashop