public function __construct($name = null) { $this->getValidatorChain()->attach(new Size(array('min' => '1kB', 'max' => '10MB')))->attach(new Extension(array('jpg', 'jpeg', 'png', 'gif'))); //->attach(new MimeType('image')); parent::__construct($name); }