All pastes #428743 Raw Edit

renewbie

public html v1 · immutable
·published 2007-04-07 20:03 UTC
rendered paste body
-- function from backend/modules/state/action/action.class.php --  public function executeGetState()  {    $countryID=$this->getRequestParameter('countryID');    if($countryID != 0 || $countryID != '')      {	$statepeer = new StatePeer();	$this->stateArr = $statepeer->getStateByCountryId($countryID);      }    else      {	$myArr[0] = "----- Select -----";          $this->stateArr = $myArr;      }  }-- End function from backend/modules/state/action/action.class.php ---- file backend/modules/state/templates/getStateSuccess.php --$customForm = new customForms();echo $customForm->parseOptions($stateArr);-- End file backend/modules/state/templates/getStateSuccess.php ---- parseOptions() --  public function parseOptions($optArr)  {    if(is_array($optArr))      {	$retStr = "";	foreach($optArr As $key => $value)	  {	    $retStr .= "<option value='".$key."'>".$value."</option>";	    unset($key);	    unset($value);	  }	      }    else      {	$retStr .= "<option value=0>--- Select ---</option>";      }    return $retStr;  }-- End parseOptions() --