Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
validate a posted array?
  • I'm looking to validate a posted array, but not having any luck.. something along the lines of this:
    $val->add('meta_data["first_name"]', 'First Name')
              ->add_rule('required');
      $val->add('meta_data["last_name"]', 'Last Name')
              ->add_rule('required');
      $val->add('meta_data["time_zone"]', 'Time Zone')
              ->add_rule('required');
    

    Is something like this possible?
  • No, because you validate fields - not parts of fields. If you use an array for fields that means you consider it one field, not multiple. Thus if you want to validate an array you have to write a validation method for that array.
  • Alright, thanks for the input.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion