public function validate($value) { foreach ($this->validates as $name => $config) { $di = DependencyInjection::get("form-populate-" . strtolower($name)); if ($di) { $di = $di(); if (!$di->validate($value, $config)) { $this->errors[] = sprintf($di->getMessage(), $this->getName()); return false; } } } return true; }