|
Posted by Steve on 08/24/07 21:24
"Phil Latio" <phil.latio@f-in-stupid.co.uk> wrote in message
news:RABzi.311528$tb2.204848@fe02.news.easynews.com...
| Still having fun trying to build the perfect form and validation classes
and
| wondered if anyone can help on the following.
such an animal does not exist. ;^)
| This is part written function that I will use to pass the multiple values
to
| the array.
|
| function setValidationParameters($number, $parameter)
| {
| $this->fields[$number][validationparameter] = $parameter;
| }
|
| I am beginning to confuse myself and wondering if anyone can add some
sanity
| to what I am doing.
unless you are telling php that 'validationparater' should be interpreted as
a string value:
$this->fields[$number][validationparameter] = $parameter;
should be:
$this->fields[$number][$validationparameter] = $parameter;
however, where would it come from in that function. in either case, with the
code as-is as posted here, the value of the field with key $number will have
a blank array element and its value will be the value of the $parameter the
last time you called the function...which is probably not what you were
going for.
PLUS, please keep your casing consistent with best practices...either camel
case, pascal case, or underscore your variables:
$validationParameter;
$ValidationParameter;
$validation_parameter;
respectively.
[Back to original message]
|