gpt4 book ai didi

zend-framework - 如何以zend形式设置元素

转载 作者:行者123 更新时间:2023-12-04 03:37:36 25 4
gpt4 key购买 nike

我有一个zend表单,其中包含许多元素。我在很多地方都使用表格。我有一个file元素,那就是:

$file= new Zend_Form_Element_File('merchantLogo');
$file->setDestination("application_data/merchant/logo/original/");
$file->addValidator('Count', false, 1);
$file->addValidator('Extension', false, 'jpg,png,gif,jpeg');
$file->setDecorators(array('ViewHelper','Errors'));

现在,我想问的是如何取消设置此zend表单的任何元素。我想要这样做是因为尽管在我的一项操作中我没有使用此元素,但是此元素正在造成问题。
那么如何取消设置任何元素?

最佳答案

使用Zend_Form::removeElement()。参见http://framework.zend.com/manual/en/zend.form.forms.html#zend.form.forms.elements.methods

例子

$form->removeElement('merchantLogo');

关于zend-framework - 如何以zend形式设置元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7913099/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com