Closed GoogleCodeExporter closed 9 years ago
Scrap that guys I just saw that the key of the array can be used as the id
value. It would be a good idea to add it to the documentation, I had to read
the source.
Original comment by lordro...@gmail.com
on 1 Oct 2011 at 6:08
Agreed, the documentation as a whole needs to improve. With limited time to
devote to this project, this area often gets neglected. That being said...
Any element that extends the ElementOption abstract class (Select, Checkbox,
Radio, Sort, Checksort, etc) can accept either a one or two dimensional array
to represent its options parameter. If a one dimensional array is passed, the
value and displayed text will be the same. For two dimensional arrays, the
keys will be set as values and the array's values will be used as the displayed
text.
It sounds like you discovered this after looking through the source (good for
you btw for taking the initiative), but I thought I'd quickly re-iterate for
future readers of this post.
- Andrew
Original comment by ajporterfield@gmail.com
on 1 Oct 2011 at 6:28
Hey guys,
I've tried in so many ways (two-dimentsional array) but could not make it work.
Could you please show me some snippets of this code? Thanks.
-Clan
Original comment by cjcl...@gmail.com
on 26 Dec 2011 at 3:25
$form->addElement(new PFBC\Element\Select("Select:", "Select", array(
"" => "--Select Option--",
"1" => "Option #1",
"2" => "Option #2",
"3" => "Option #3",
)));
Original comment by ajporterfield@gmail.com
on 26 Dec 2011 at 5:03
Original issue reported on code.google.com by
lordro...@gmail.com
on 1 Oct 2011 at 6:03