[Agavi-Users] array validation

32 views
Skip to first unread message

Jeramy Wenserit

unread,
Jan 25, 2010, 1:49:58 PM1/25/10
to Agavi Users Mailing List
Hi,

If i've got the following array structure:

$a = array(
0 => array(
'name'=>'moo',
'age'=>23
),
1 => array(
'name'=>'moo',
'age'=>23
),
2 => array(
'name'=>'moo',
'age'=>23
),
);

What is the best way for me validate $a and all the child array items so that i receive the identical array above in my action?

Cheers,

Jeramy Wenserit (E_mE)
e: evercl...@gmail.com
w: www.xylesoft.co.uk


_______________________________________________
users mailing list
us...@lists.agavi.org
http://lists.agavi.org/mailman/listinfo/users

David Zülke

unread,
Jan 25, 2010, 3:19:40 PM1/25/10
to Agavi Users Mailing List
<validator class="MyNameValidator">
<arguments base="a[]">
<argument>name</argument>
</arguments>
</validator>
<validator class="number">
<arguments base="a[]">
<argument>age</argument>
</arguments>
<ae:parameter name="min">18</ae:parameter>
<ae:parameter name="max">120</ae:parameter>
</validator>
<validator class="arraylength">
<arguments base="a[]">
<argument />
</argument>
<ae:parameter name="min">2</ae:parameter>
<ae:parameter name="max">2</ae:parameter>
</validator>

Jeramy Wenserit

unread,
Jan 26, 2010, 5:51:14 AM1/26/10
to Agavi Users Mailing List
Hi,

Perfect, great thank you :)

Cheers,
Jeramy

Reply all
Reply to author
Forward
0 new messages