[eluser]Mitja[/eluser]
Why this is not working. I want to use it in view/admin/arrangement_edit.php
Code:
<tr>
<td>
Odhod:
<select name="departure_type">
<?php echo $this->function_model->gkListArrayAsOptions($TransportTypesArray, $row->departure_type); ?>
</select>
</td>
</tr>
this is model/function_model.php file
Code:
class Function_model extends Model {
function Function_model()
{
parent::Model();
}
function gkListArrayAsOptions($array, $selected=null)
{
$output = "";
foreach($array as $value=>$text)
{
$selectAtt = "";
if ($value == $selected) $selectAtt = "selected=\"selected\"";
$output .= "<option value=\"$value\" $selectAtt>$text</option>";
}
return $output;
}
}