I have a company
class and that has a phone
class on property $phone
. I will validate the phone property based on my PhoneValidation
class.
my validation class
class Company extends Validation
{
public function initialize()
{
$phoneValidation = new Phone();
$validators = $phoneValidation->getValidators();
foreach ($validators as $validator) {
$this->add('phone['.$validator[0].']', $validator[1]);
}
this doesn't work.