Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Validation valid_date example
  • Just to save someone else some time.

    If you want to use valid_date in a model. The format of the date format must not be quoted.

    Like this:

       $val->add_field('publish_start_date', 'Start Date', 'valid_date[m/d/Y g:i A]');

    I mistakenly kept trying like:

       $val->add_field('publish_start_date', 'Start Date', 'valid_date["m/d/Y g:i A"]');

    and could not for the life of me figure out why I kept getting errors!  

    The error it was giving me was:
    The format separator does not match
  • Correct, the regex behind it splits on the square brackets, making the double quotes part of the match string.

Howdy, Stranger!

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

In this Discussion