예제 #1
0
 public function isValid($data)
 {
     if (!is_array($data)) {
         require_once 'Zend/Form/Exception.php';
         throw new \Zend_Form_Exception(__METHOD__ . ' expects an array');
     }
     return parent::isValid($data);
 }
 /**
  * Validate the form
  *
  * @param  array $data
  * @return boolean
  */
 public function isValid($data)
 {
     if (!is_array($data)) {
         require_once 'Zend/Form/Exception.php';
         throw new Zend_Form_Exception(__METHOD__ . ' expects an array');
     }
     if ($data['name'] == 'xyz') {
         $this->getElement('name')->addError('Wrong name provided!');
     }
     return parent::isValid($data);
 }