Can anyone point me to (or give me) an example of an input filter for
an integer? My requirements are that we ensure the input is an
integer, it is required and it must fall between and min and max
values (inclusive). I can probably just about figure this out, but
should i be doing things like strip tags? I'm guessing not because if
we are ensuring it is a number the tags can't be present can they?

I'm guessing something like this;

$inputFilter->add($factory->createInput(array(
    'name' => 'somevalue',
    'required' => true,
    'validators' => array(
        array(
            'name' => 'Int',
            'options' => array(
                'min' => 1,
                'max' => 50,
            ),
        ),
    ),
)));

Steve

-- 
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com


Reply via email to