cashOutForm.class.php 760 Bytes
Newer Older
Игорь's avatar
init    
Игорь committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php

class cashOutForm extends BaseForm
{
    public function configure()
    {
        $this->widgetSchema['card'] = new sfWidgetFormInputText(array(), array('size' => 20, 'placeholder' => 'Номер карты', 'required' => true, 'autocomplete' => 'off', 'autofocus' => 'on'));
        $this->validatorSchema['card'] = new sfValidatorAnd(array(
            new sfValidatorString(array('min_length' => 13)),
            new sfValidatorRegex(array('pattern' => '/^[0-9]*$/'), array('invalid' => 'Неверный формат')),
        ));
        $this->useFields(array('card'));
        $this->widgetSchema->setNameFormat('out[%s]');
    }

    public function isValid()
    {
        $is_valid = parent::isValid();

        return $is_valid;
    }
}