1

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'
        ));
4

1 回答 1

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上看到

希望它对你有用。

于 2013-09-19T09:29:14.750 回答