replace Exception on GeneralException

This commit is contained in:
Vyacheslav Agafonov
2011-11-25 13:54:31 +04:00
parent 669b68ba4a
commit 7d215c9af4
6 changed files with 15 additions and 15 deletions

View File

@ -39,7 +39,7 @@ abstract class Form
public function isValid($data)
{
if (!is_array($data)) {
throw new Exception(__CLASS__ . '::' . __METHOD__ . ' expects an array');
throw new InitializationException(__CLASS__ . '::' . __METHOD__ . ' expects an array');
}
foreach ($this->fields as $field_name => $field) {

View File

@ -72,7 +72,7 @@ class FormField
$name = $validator . 'Validator';
$validator = new $name();
} else {
throw new Exception('Invalid validator provided to addValidator; must be string or iValidator');
throw new InitializationException('Invalid validator provided to addValidator; must be string or iValidator');
}
$this->validators[$name] = $validator;
return $this;
@ -94,7 +94,7 @@ class FormField
$name = $filter . 'Filter';
$filter = new $name();
} else {
throw new Exception('Invalid filter provided to addFilter; must be string or iFilter');
throw new InitializationException('Invalid filter provided to addFilter; must be string or iFilter');
}
$this->filters[$name] = $filter;
return $this;
@ -147,7 +147,7 @@ class FormField
if (!$validator->isValid($val, $context)) {
$valid = false;
if (!$this->default_message) {
throw new Exception('Define default message for array fields');
throw new InitializationException('Define default message for array fields');
}
$this->message = $this->default_message;
}

View File

@ -18,7 +18,7 @@ class FormViewHelper extends ViewHelper
{
if ($this->data === null) {
if ($form == null) {
throw new Exception('Form name required for helper init');
throw new InitializationException('Form name required for helper init');
}
$this->data = Session::get($form, array());
Session::del($form);
@ -34,7 +34,7 @@ class FormViewHelper extends ViewHelper
return $this->view->escape($default);
}
public function message($field)
public function message($fgrepield)
{
if (isset($this->data['messages'][$field])) {
return '<span class="error">' . $this->view->escape($this->data['messages'][$field]) . '</span>';