-- Lorenz, Marcus <[EMAIL PROTECTED]> wrote
(on Monday, 21 July 2008, 01:46 PM +0200):
> i have a little question regarding the creation of own elements within forms.
> Can i (and when how) create a custom element and add it to form by a
> config-file?
> 
> I've found examples for validator decorator and filters, but nothing for the
> element itself (or i've missed it).

Absolutely you can, and the rules are pretty much just like for adding
decorators, validators, and filters.

Let's say you create an element, My_Form_Element_FooBar. You then need
to tell your form to look for elements on the 'My_Form_Element' prefix
path, which you would do via the 'prefixPath' configuration setting:

    fooForm.prefixPath.element.myFormElement.prefix = "My_Form_Element"
    fooForm.prefixPath.element.myFormElement.path = "My/Form/Element"

Then, to add a new "FooBar" element via configuration, you would simply
reference the type, "FooBar", and it will be found automatically.

-- 
Matthew Weier O'Phinney
Software Architect       | [EMAIL PROTECTED]
Zend Framework           | http://framework.zend.com/

Reply via email to