Skip to content
Permalink
Browse files

Simplify hasError()

  • Loading branch information...
markstory committed Feb 4, 2014
1 parent cd9a0f7 commit 64f1d2d05cf7170f3632a4c590be0a6abf73ed8e
Showing with 1 addition and 7 deletions.
  1. +1 −7 src/View/Form/EntityContext.php
@@ -287,13 +287,7 @@ public function attributes($field) {
* @return boolean Returns true if the errors for the field are not empty.
*/
public function hasError($field) {
$parts = explode('.', $field);
list($entity, $prop) = $this->_getEntity($parts);
if (!$entity) {
return false;
}
$errors = $entity->errors(array_pop($parts));
return !empty($errors);
return $this->error($field) !== [];
}
/**

0 comments on commit 64f1d2d

Please sign in to comment.
You can’t perform that action at this time.