i have been checking out the documentation for PFBC trying to find out how I could have my select tag have a different value from it’s key/name in effect being able ot have this
<option value="foo">bar</option>
Normally select is written like that
$form->addElement(new Element_Select("My Select:", "MySelect", array( "Option #1", "Option #2", "Option #3" )));
By reading the code of the class I have found out that the functionality is actually there. All that you need to do is to replace the ‘Option’ with ‘key’ => ‘value’.
If you are fetching database results or you have a somehow dynamic array this is the structure the array should have.
array(3) { ["value1"]=> string(19) "Dimitris" ["value2"]=> string(12) "Janet" ["value3"]=> string(7) "Yiannis" }
And this is the format of the select call when you use an array.
$form->addElement(new PFBC\Element\Select("LABEL", "SELECTID", $array ));
I hope this helps if you have any questions let me know.