|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Theofiel Boomerang Smarty n00b
Joined: 22 May 2018 Posts: 3
|
Posted: Fri Jul 27, 2018 1:04 pm Post subject: Show data of a table based upon an other table |
|
|
Hi there,
i'm a total noob on smarty and don't know anything about it. However i sometimes need smarty, as in this case:
I want to show data from a productfeed table based upon a record that's linked on a customer database.
I have a customer database linked with a 1:n relation to a cart table. Everytime someone leaves a cart a record is created in that cart table. In that record i then get a productnumber and want to lookup the information of that product in a producttable that's daily filled with a productfeed.
Is there any method on how to do this?
Thanks! |
|
Back to top |
|
bsmither Smarty Elite
Joined: 20 Dec 2011 Posts: 322 Location: West Coast
|
Posted: Sat Jul 28, 2018 6:58 am Post subject: |
|
|
I am thinking not inherently.
But, one can create an Output Filter that can determine the value of the key dynamic variable, fetch more database recordsets, process the recordsets, and populate other template variables before finally spitting out the finished HTML. |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Sat Jul 28, 2018 3:24 pm Post subject: |
|
|
I have feeling you don't understand the role of Smarty.
Smarty is a PRESENTATION layer, it handles the data already retrieved and arranged for presentation.
You should do all your business logic in your PHP code. |
|
Back to top |
|
|
|
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
|