-- JI Sánchez <[EMAIL PROTECTED]> wrote
(on Thursday, 24 April 2008, 10:12 AM -0700):
> I'm confused about filter's configuration with XML. This is my question.
> 
> how do you use filter in config xml? Is there any documentation with
> explication about this configuration?
> 
> My problem is that i dont know which name of the node i must use.

They're arbitrary; the main thing is that you want to ensure that an
array is returned for each filter by Zend_Config; the keys are actually
ignored. To use your examples below:

    <filters>
        <lower>
            <filter>StringToLower</filter>
            <options>....</options>
        </lower>
        <tags>
            <filter>StripTags</filter>
        </tags>
        <less>
            <filter>LessThan</filter>
        </less>
        ...
    </filter>

When using an XML config, you could also use the *same* name, as it will
interpret these as simply an indexed array:

    <filters>
        <filter>
            <filter>StringToLower</filter>
            <options>....</options>
        </filter>
        <filter>
            <filter>StripTags</filter>
        </filter>
        <filter>
            <filter>LessThan</filter>
        </filter>
        ...
    </filter>


> for example:
> 
> StringToLower
>             <filters>
>       <lower>
>                      <filter>StringToLower</filter>
>       </lower>
>            </filters>
> 
> But with StripTags, i don't know which name of the node i must use.
>             <filters>
>       <tags??????>
>                      <filter>StripTags</filter>
>       </tags????>
>            </filters>
> 
> 
> I have the same problem with Validations.
> StringLength - strlen.
> LessThan - ?????
> EmailAddress - email?
> etc,etc,

-- 
Matthew Weier O'Phinney
Software Architect       | [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/

Reply via email to