如何在Zend_Form中的textarea中添加一些文本?

时间:2013-09-19 09:18:20

标签: forms zend-framework textarea

如何将信息放入Zend_Form中的textarea标签中?例如:

<textarea name="descNews" id="descNews" rows="5" class="txt_meta" cols="80">This is text!</textarea>

Zend表格:

$description = new Zend_Form_Element_Textarea('descNews');
    $description->addFilter('StripTags')
                ->setAttribs(array(
                'rows'        => '5',
                'class'       => 'txt_meta'
        ));

1 个答案:

答案 0 :(得分:2)

您可以使用setValue(mixed $value)

$description = new Zend_Form_Element_Textarea('descNews');

    $description->addFilter('StripTags')
                ->setAttribs(array(
                'rows'        => '5',
                'class'       => 'txt_meta'
        ));

$description->setValue('set your default vallue');

或者您可以在zend doc

上看到 希望它对你有用。