开发者

set lable to elements created by createElement method in zend framework

开发者 https://www.devze.com 2023-03-21 23:47 出处:网络
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.

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

精彩评论

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