开发者

How can I get the description of a select multioptions tag in ZF?

开发者 https://www.devze.com 2023-01-08 11:37 出处:网络
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

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];
0

精彩评论

暂无评论...
验证码 换一张
取 消