View Single Post
  #3  
Old 05-17-2004, 09:53 PM
  Waylon's Avatar 
Waylon Waylon is offline
 

Newbie
  
Join Date: May 2004
Posts: 9
 

Default Re: How can I get this stuff from PHP to Smarty?

Quote:
Originally Posted by ngwheels
$test = array(blue, yellow, red, orange);

How can I get this to show up in a select box on my page? The will be dynamic based upon a couple variables received by the page, thats why I don't just type them straight into the template...

I found this snippet on the Zend site (http://www.zend.com/zend/tut/tutorial-cezar.php):

You can create an array in PHP an pass it to the template:

Code:
$tmp = array ( 'UID'=> '10', &'Name' => 'John Doe', 'Address'=>'Home address'); $smarty->assign('info', $tmp);

Then build the drop-down from the array. I haven't tried it, but it looks pretty straightforward.
Reply With Quote