0

我正在尝试在我的一个元素上设置一个自定义装饰器。我想在一个ini文件中做到这一点。但我在使用其他设置时遇到了一些问题。

之间有冲突:

;remove extra tags that i don't need
decorators.formElements.decorator = FormElements
decorators.form.decorator = Form
decorators.FormErrors.decorator = FormErrors

;i can't use my element decorator because of these 3 lines
elementdecorators.viewhelper.decorator = ViewHelper
elementdecorators.label.decorator = Label
elementdecorators.description.decorator = Description

还有我的自定义装饰器:

elementPrefixPath.decorator.prefix = "My_Decorator"
elementPrefixPath.decorator.path = "my/path/to/decorators/"

elements.numero.options.decorators.SimpleInput.decorator = "SimpleInput"

无论如何,我添加它的唯一方法是通过 PHP

$v_form = new Custom_Form();
$v_Element = $v_form->getElement(Custom_Form::NUMERO);
$v_Element->setDecorators(array('SimpleInput'));

当然它可以工作,但我想通过配置文件设置我的表单。我仅将 PHP 用于特定情况(例如在构建器类中:根据用户配置文件的替代版本等)。

对我来说,由于某些优先事项而发生了冲突。或者它在第一个元素之后设置表单装饰器(因此将其删除)。

我做得对吗?有没有办法强制接受这两种设置?

顺便说一句,英语不是我的母语,我是 stackoverflow 的新手。希望我没有违反任何规则。

4

0 回答 0