Skip to content

Instantly share code, notes, and snippets.

@tomphp
Last active December 19, 2015 10:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomphp/5940505 to your computer and use it in GitHub Desktop.
Save tomphp/5940505 to your computer and use it in GitHub Desktop.
How to set up the annotation builder so it can use the hydrator manager
<?php
/*
* This is the setup required to make an annotation builder able to load
* a hydrator from annotation via the HydratorManager.
*/
$annotationBuilder = new \Zend\Form\Annotation\AnnotationBuilder();
$factory = new \Zend\Form\Factory($serviceLocator->get('FormElementManager'));
$annotationBuilder->setFormFactory($factory);
$form = $annotationBuilder->createForm($myEntity);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment