dracoblue.net

How to validate an array with agavi

If you want to validate an array as parameter for an agavi action, you have to validate each of the array entries on its own.

Assuming we have an array called

options with the value as an array:

array(
  'title'=>'string text',
  'subtitle'=>'string subtext'
)

The following snippet validates it (every element is string - sorry for the laziness):

<validator class="string" required="true">
    <arguments base="options[]">
        <argument>title</argument>
        <argument>subtitle</argument>
    </arguments>
</validator>

Thanks to

v-dogg and wombert for the hints on how to make that.

In agavi, open source, php, validator by @ 04 Feb 2009

comments powered by Disqus

Recent Files

Advertisement

Recent Dev-Articles

Read recently

About

Blogroll