wwwCallbackForm.class.php 1.06 KB
Newer Older
Яков's avatar
first  
Яков committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php

/**
 * Callback form.
 *
 * @package    sf
 * @subpackage form
 * @author     Atma
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class wwwCallbackForm extends BaseCallbackForm
{
    public function configure()
    {
        $this->useFields(array('name', 'phone', 'offer_id'));

        sfApplicationConfiguration::getActive()->loadHelpers(array('I18N'));

        $this->widgetSchema['name'] = new sfWidgetFormInputText(array(), array("size" => 64, "maxlength" => 255, "required" => true, 'placeholder' => __('Как к вам обращаться'), 'autocomplete' => 'off'));
        $this->widgetSchema['phone'] = new sfWidgetFormInputText(array(), array("size" => 64, "maxlength" => 255, "required" => true, 'placeholder' => __('Номер телефона'), 'autocomplete' => 'off'));
        $this->validatorSchema['phone'] = new sfValidatorAnd(array(
            new sfValidatorNumber(array('required' => true)),
            new sfValidatorString(array('max_length' => 255, 'required' => true))
        ));
    }
}