| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
How can I get this stuff from PHP to Smarty? | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() I'm still trying to learn this smarty templating, much more of a learning curve then I was expecting...Anyway, how do you think I could get something like the following to show up properly in the page? Lets say I have an array of
$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... Thanks in advance for your help, I appreciate all the help I've gotten so far.
__________________
Cart 3.5.4 |
|||||||
#2
|
|||||||||
|
|||||||||
![]() Something like this assuming you're using the get method of a form. This also assumes you've passed $test properly to smarty.
Quote:
Carrie
__________________
Custom Development, Custom Coding and Pre-built modules for X-cart since 2002! We support X-cart versions 3.x through 5.x! Home of the famous Authorize.net DPM & CIM Modules, Reward Points Module, Point of Sale module, Speed Booster modules and more! Over 200 X-cart Mods available & Thousands of Customizations Since 2002 - bcsengineering.com Please E-Mail us for questions/support! |
|||||||||
#3
|
|||||||||
|
|||||||||
![]() Quote:
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:
Then build the drop-down from the array. I haven't tried it, but it looks pretty straightforward. |
|||||||||
#4
|
|||||||
|
|||||||
![]() Thanks for the advice, I'll be playing with it tonight to see if I can figure something out.
__________________
Cart 3.5.4 |
|||||||
#5
|
|||||||
|
|||||||
![]() I can't believe I put this off for so long, its probably the easiest thing I've done with this site. Thanks guys.
__________________
Cart 3.5.4 |
|||||||
#6
|
|||||||
|
|||||||
![]() Smarty is a very simple program to do some awesome html stuff
check out http://smarty.php.net and check out the documentation it has all the functions and some good examples.
__________________
Mod King |
|||||||
![]() |
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|