Zend framework Zend Framework:如何删除Zend_表单_元素_文件上的DtDd装饰器?

Zend framework Zend Framework:如何删除Zend_表单_元素_文件上的DtDd装饰器?,zend-framework,zend-form-element,zend-decorators,Zend Framework,Zend Form Element,Zend Decorators,我已经尝试了所有我能想到的方法,但我不知道如何在Zend\u Form\u Element\u文件上仅显示ViewHelper装饰器 $UserPhoto = new Zend_Form_Element_File('UserPhoto'); $UserPhoto->setDestination(TMP_DIR); $UserPhoto->addValidator('Count', false, 1); $UserPhoto->addValidator('Size', false

我已经尝试了所有我能想到的方法,但我不知道如何在
Zend\u Form\u Element\u文件
上仅显示
ViewHelper
装饰器

$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>

这是我让它工作的唯一方法:

$this->addElement($UserPhoto, 'UserPhoto');
$this->UserPhoto->removeDecorator('label');
$this->UserPhoto->removeDecorator('htmlTag'); //DtDd
最短的形式是:

$UserPhoto->setDecorators(array('File'))

非常感谢。我尝试使用“ViewHelper”而不是“File”。不确定为什么文件元素没有“ViewHelper”=/非常感谢你的回答。谢谢
$UserPhoto->setDecorators(array('File'))