root/trunk/lib/form/shared/BaseContactForm.class.php

Revision 75, 0.9 kB (checked in by nperriault, 5 months ago)

[1.1]:

  • Companies and people modules migrated, with according form classes and templates, and functional test suite
  • Enhanced SymfoniansTestBrowser?
Line 
1 <?php
2 /**
3  * Base contact form
4  *
5  * @package form
6  */
7 class BaseContactForm extends sfForm
8 {
9   /**
10    * Form configuration
11    *
12    */
13   public function setup()
14   {
15     $this->setWidgets(array(
16       'subject' => new sfWidgetFormInput(),
17       'body'    => new sfWidgetFormTextarea(),
18       'captcha' => new sfWidgetFormReCaptcha(array('public_key' => sfConfig::get('app_recaptcha_public_key'))),
19     ));
20
21     $this->setValidators(array(
22       'subject' => new sfValidatorString(array('min_length' => 5), array('min_length' => 'This subject is too short (5 characters minimum)')),
23       'body'    => new sfValidatorString(array('min_length' => 10), array('min_length' => 'This message body is too short (10 characters minimum)')),
24       'captcha' => new sfValidatorReCaptcha(array('private_key' => sfConfig::get('app_recaptcha_private_key'))),
25     ));
26
27     $this->widgetSchema->setNameFormat('contact[%s]');
28   }
29 }
Note: See TracBrowser for help on using the browser.