[Configuration] Cleaner organization (fixes #10)

This commit is contained in:
Gregwar
2011-12-02 18:36:34 +01:00
parent 249036c745
commit c0530a0b26
3 changed files with 16 additions and 18 deletions

View File

@ -76,20 +76,25 @@ class CaptchaType extends AbstractType
*/
protected $session;
/**
* Session key
* @var String
*/
private $key = 'captcha';
public function __construct(Session $session, $width, $height, $length, $asFile, $imageFolder, $webPath, $gcFreq, $expiration)
public function __construct(Session $session, $config)
{
$this->session = $session;
$this->width = $width;
$this->height = $height;
$this->length = $length;
$this->asFile = $asFile;
$this->imageFolder = $imageFolder;
$this->webPath = $webPath;
$this->gcFreq = $gcFreq;
$this->expiration = $expiration;
$this->width = $config['width'];
$this->height = $config['height'];
$this->length = $config['length'];
$this->asFile = $config['as_file'];
$this->imageFolder = $config['image_folder'];
$this->webPath = $config['web_path'];
$this->gcFreq = $config['gc_freq'];
$this->expiration = $config['expiration'];
}
public function buildForm(FormBuilder $builder, array $options)