2

考えられるすべてのことを試しましたが、ViewHelperデコレータのみを に表示する方法がわかりませんZend_Form_Element_File

$UserPhoto = new Zend_Form_Element_File('UserPhoto');
$UserPhoto->setDestination(TMP_DIR);
$UserPhoto->addValidator('Count', false, 1);
$UserPhoto->addValidator('Size', false, 10240000); // 10 mb max
$this->addElement($UserPhoto);

私のビュースクリプトで:

echo $this->form->UserPhoto

生成するもの

<dt>label</dt>
<dd>input element</dd>

これは私が欲しいものです:

input element
4

2 に答える 2

2

これが私がそれを機能させる唯一の方法でした:

$this->addElement($UserPhoto, 'UserPhoto');
$this->UserPhoto->removeDecorator('label');
$this->UserPhoto->removeDecorator('htmlTag'); //DtDd
于 2010-08-05T19:30:56.420 に答える
2

最短の形式は次のとおりです。

$UserPhoto->setDecorators(array('File'))
于 2010-08-05T21:40:27.063 に答える