public function onSubmit(FormRuntime $formRuntime, &$elementValue)
    {
        $fileTypeValidator = new FileTypeValidator(array('allowedExtensions' => $this->properties['allowedExtensions']));
        $this->addValidator($fileTypeValidator);
    }
public function onSubmit(FormRuntime $formRuntime, &$elementValue)
    {
        $fileTypeValidator = new FileTypeValidator(array('allowedExtensions' => $this->properties['allowedExtensions']));
        $this->addValidator($fileTypeValidator);
    }
public function onSubmit ( FormRuntime $ formRuntime , & $ elementValue ) { $ fileTypeValidator = new FileTypeValidator ( array ( 'allowedExtensions' => $ this -> properties [ 'allowedExtensions' ] ) ) ; $ this -> addValidator ( $ fileTypeValidator ) ; }
Add FileTypeValidator just before submitting so that the "allowedExtension" can be changed at runtime

@param FormRuntime $formRuntime
@param mixed $elementValue
@return void
Add FileTypeValidator just before submitting so that the allowedExtension can be changed at runtime