Zend Framework: как удалить декоратор DtDd в файле Zend_Form_Element_File?
Я перепробовал все, что мог придумать, и не могу понять, как отобразить только 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
2 ответа
Решение
Самая короткая форма:
$UserPhoto->setDecorators(array('File'))
Это был единственный способ заставить его работать:
$this->addElement($UserPhoto, 'UserPhoto');
$this->UserPhoto->removeDecorator('label');
$this->UserPhoto->removeDecorator('htmlTag'); //DtDd