Skip to content

Commit

Permalink
Return specified default value in EntityContext
Browse files Browse the repository at this point in the history
With the current implementation the default value is ignored when the EntityContext was created from an array.
  • Loading branch information
nrother committed Feb 17, 2017
1 parent e7515bc commit f4b9075
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/View/Form/EntityContext.php
Expand Up @@ -262,7 +262,7 @@ public function val($field, $options = [])
if (is_array($entity)) {
$key = array_pop($parts);

return isset($entity[$key]) ? $entity[$key] : null;
return isset($entity[$key]) ? $entity[$key] : $options['default'];
}

return null;
Expand Down

0 comments on commit f4b9075

Please sign in to comment.