How can I get the description of a select multioptions tag in ZF?
How can I get the description of a select multioptions tag in ZF?
If I do this, then I recieve the value, but a want the de开发者_JS百科scription
$subjectTitle = $feedbackForm->getValue('subjecttitle');
Use the getDescription()
method on the element, something like:
<?php
$form->getElement('element_name')->getDescription();
Edit: OK, after figuring out what you want, here's a possible solution:
<?php
$options = $form->getElement('my_select')->getMultiOptions();
// on form submition then do
$value = $form->getValue('my_select');
echo $options[$value];
精彩评论