wwwBasketOrderForm.class.php 1.85 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
<?php

/**
 * BasketOrder form.
 *
 * @package    sf
 * @subpackage form
 * @author     Atma
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class wwwBasketOrderForm extends BaseBasketOrderForm
{
    public function configure()
    {
        $this->useFields(array('username', 'phone', 'email', 'delivery_type', 'delivery_address', 'comment'));

        $this->widgetSchema['username'] = new sfWidgetFormInputText(array(), array("size" => 64, "maxlength" => 255, "required" => true, "placeholder" => "Как к вам обращаться", "class" => "basket_buyer__inp_name validate_it", "size" => 27));
        $this->widgetSchema['phone'] = new sfWidgetFormInputText(array(), array("size" => 24, "maxlength" => 24, "required" => true, "placeholder" => "Номер телефона", "class" => "basket_buyer__inp_name validate_it", "size" => 27));
        $this->widgetSchema['email'] = new sfWidgetFormInputText(array(), array("size" => 24, "maxlength" => 255, "required" => true, "placeholder" => "Email", "class" => "basket_buyer__inp_name validate_it", "size" => 27));
        $this->widgetSchema['delivery_address'] = new sfWidgetFormTextarea(array(), array('cols' => 40, 'rows' => 4, 'placeholder' => 'Адрес доставки'));
        $this->widgetSchema['comment'] = new sfWidgetFormTextarea(array(), array("rows" => 4, 'placeholder' => 'Напишите здесь пожелания к заказу'));

        $this->validatorSchema['delivery_type'] = new sfValidatorChoice(array('choices' => array(0 => 'Самовывоз', 1 => 'Доставка по адресу'), 'required' => true));

Яков's avatar
two    
Яков committed
25
26
27
28
        $this->validatorSchema['phone'] = new sfValidatorAnd(array(
            new sfValidatorNumber(array('required' => true)),
            new sfValidatorString(array('max_length' => 24, 'required' => true))
        ));
Яков's avatar
first  
Яков committed
29
30
    }
}