开发者

set lable to elements created by createElement method in zend framework

Hello All,

I'm looking for someone who can tell me how to set a label to an element created by createElement() method in zend form.

I want to create an array of input element开发者_高级运维s with label.

Thanks In Adv.


...how to set a label to an element created by createElement() method in zend form

$form->createElement('text', 'someElement', array(
    'label' => 'Some label',
));


In ZF1, If an element has already been created and added to a form and you want to change the label later. Grab the element and use the setLabel method on it:

<?php
$myForm->getElement('lastName')->setLabel('Surname');
?>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜