How to assign a name to dropdown options

Using the Phalcon framework, I have a Form class file in which I declare select

and render

in the .volt


$soc_bulding =  new Select("soc_building_id", $options['soc_bulding'], 
    array('using' => array('soc_building_id', 'soc_building_name'), 
          "class" => "mandatory-field") );
$soc_bulding->setLabel("Buiding name" . REQ_FIELD);


in the above code 'using' => array('soc_building_id', 'soc_building_name')

reflect soc_building_id

both the parameter value and the soc_building_name

actual text in the dropdown, but I want another property name in the same option field, which already tried to pass 3 parameters to an array, but it doesn't work.


source to share

1 answer

Please use the below code and replace yours

echo $this->tag->select(array("users",
        "useEmpty"  =>  true,
        "emptyText" =>  "Please select",
        "using" => array("id", "name"),




All Articles