All pastes #453946 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-04-23 09:41 UTC
rendered paste body
controller:

$c = new Criteria();
$c->clearSelectColumns();
$c->addSelectColumn(HolidayTypePeer::ID);
$c->addSelectColumn(HolidayTypePeer::NAME);
$holidayTypess = HolidayTypePeer::doSelect( $c );

foreach($holidayTypess as $holidayType)
{
   $xx[ $holidayType->getId() ] = $holidayType->getName();
}

$this->myDropDownValue = $xx;

view:

<?php echo select_tag('myDropDown', option_for_select($myDropDownValue) ) ?>

where myDropDown is the name of select tag
$myDropDwonValue is an array of id & Name to be displayed on the dropdown box -> $myDropDownValue came from $this->myDropDownValue from the controller