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

Arrays Smarty- Help

 
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 -> General
View previous topic :: View next topic  
Author Message
heliomoreira
Smarty n00b


Joined: 19 Jan 2015
Posts: 3

PostPosted: Mon Jan 19, 2015 6:40 pm    Post subject: Arrays Smarty- Help Reply with quote

Hi everyone,

I'm beginner on Smarty.

I need to do this:

I have one array with categories and products.

Now, i need create tabs with only categories from that array (without duplicate items), and another list with produts for each tab/category.

Something like this:

array (category1, product1, category 2, product 2, category2, product 2.1)

The "Tabs"

[b]Category1[/b]
Product1

[b]Category2[/b]
Product 2
Product 2.1

Thank you.

Best Regards,
HMoreira
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Mon Jan 19, 2015 11:26 pm    Post subject: Reply with quote

For that, you need to write code, which will be doing it.
This is not a Smarty question.
Back to top
View user's profile Send private message
heliomoreira
Smarty n00b


Joined: 19 Jan 2015
Posts: 3

PostPosted: Tue Jan 20, 2015 9:09 am    Post subject: Reply with quote

Hi AnrDaemon,

Thank you for your reply.

I know do this in "Pure" PHP, but not in smarty.

Thank you.

BR
HMoreira
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Tue Jan 20, 2015 9:24 am    Post subject: Reply with quote

That's exactly what I said.
Data manipulation is not a task for template engine.
Template engine need already prepared data it can put into template and show to the user.
Back to top
View user's profile Send private message
heliomoreira
Smarty n00b


Joined: 19 Jan 2015
Posts: 3

PostPosted: Tue Jan 20, 2015 9:34 am    Post subject: Reply with quote

Hi AndDaemon,

Thanks.
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 -> 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