|
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 |
bonzocs Smarty Rookie
Joined: 19 Jul 2006 Posts: 27 Location: Cardiff - Wales
|
Posted: Tue Jan 16, 2007 11:30 pm Post subject: Accessing assigned array in PHP tags |
|
|
Hi All,
I have an array from a MySQL query stored in a php file.
Example:
Quote: | $smarty->assign('array_result',$myarray); |
Now in the template I would like to access that array, but from within php tags.
Example:
Quote: | {php} $array_results {/php} |
Does anyone know how this could be done?
Cheers |
|
Back to top |
|
Pap Smarty Regular
Joined: 21 Jun 2006 Posts: 69 Location: Denver, CO
|
Posted: Wed Jan 17, 2007 2:15 am Post subject: |
|
|
The tags put you into PHP. You do whatever you want with it that you want to, using normal PHP code. _________________ Don't be stupid, be a Smarty™.
Come and join the P-H-Party. |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
|
Back to top |
|
Hielke Hoeve Smarty Elite
Joined: 06 Jan 2006 Posts: 406 Location: Netherlands
|
Posted: Wed Jan 17, 2007 8:21 am Post subject: |
|
|
use {foreach} or {section} if you want to create a list or loop over the results in your template (in case you didnt know). _________________ Debug XHTML Compliance
SmartyPaginate
Smarty License Questions
---
(About Unix) The learning curve is full of aha! moments, such as that glorious day that the full beauty of grep and, later, find is revealed in all its majesty. --- Robert Uhl <ruhl@4dv.net> |
|
Back to top |
|
bonzocs Smarty Rookie
Joined: 19 Jul 2006 Posts: 27 Location: Cardiff - Wales
|
Posted: Sat Jan 20, 2007 1:15 pm Post subject: |
|
|
Thats exactly what I was looking for - thanks guys |
|
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
|