PHP Classes

Error in Form Class

Recommend this page to a friend!

      Another Form generator  >  All threads  >  Error in Form Class  >  (Un) Subscribe thread alerts  
Subject:Error in Form Class
Summary:Error in From Class when calling validator
Author:Andy Ward
Date:2011-07-14 08:59:40
Update:2011-07-14 11:08:07

  1. Error in Form Class   Reply   Report abuse  
Picture of Andy Ward Andy Ward - 2011-07-14 08:59:40

I had the need to validate two form fields with respect to each other. Essentially a From Date and a To Date.

The line in the protected function validateFields()

has the following line:

$this->error($id, $this->validator->{$validatorFunc}($value, array_slice($args, 2)),$this->input);

I believe it SHOULD read

$this->error($id, $this->validator->{$validatorFunc}($value, array_slice($args, 2),$this->input));

The second close bracket after $args,2 should be at the end of the line.

Great class. Love it


  2. Re: Error in Form Class   Reply   Report abuse  
Picture of Gergely Aradszki Gergely Aradszki - 2011-07-14 11:08:07 - In reply to message 1 from Andy Ward

Yes, you're right. To be honest, I've already fixed it, but I forgot to update it here. I'll post the update soon, it has some new functions too, but it has to be tested a bit more to avoid issues like this one. (Yes, It seem I'll have to write the unit tests)