przewiń do treści

Zend Framework od podstaw

Włodzimierz Gajda

$this->addElement('text', 'isbn', array(
    'label'      => 'ISBN:',
    'validators' => array(
        array('Isbn', true, array('separator' => '-'))
    )
));
$this->isbn->getValidator('Isbn')->setMessages(array(
    Zend_Validate_Isbn::INVALID => "Niepoprawny numer ISBN",
    Zend_Validate_Isbn::NO_ISBN => "'%value%' nie jest poprawnym numerem ISBN",
));

Listing 30.12. Badanie poprawności numeru ISBN

Rozdział 30. Walidatory i filtry

listing-30-12.txt