fuel / validation

FuelPHP Framework - Data Validation library
70 stars 14 forks source link

Date rule string or array #51

Open Delpfine opened 8 years ago

Delpfine commented 8 years ago
 $val->addField('date2')
            ->date('d-m-Y');

I`m get error "Illegal string offset 'format'"; in /vendor/fuelphp/validation/src/Rule/Date.php at line 47

Maybe you should use

 $val->addField('date2')
            ->date(['format' =>'d-m-Y']);

correct documentation, or correct the problem in the class Date.php $format = $parameters['format'];