ZF2: Equivalent of getServiceLocator in Zend Form
assumption: Event\Service\EventService is my personal object that works with Event\Entity\Event entities This code works in an ActionController: $eventService = $this->getServiceLocator()->get('Event\Service\EventService'); How can I get $eventService in a Zend\Form\Form in the same way? You have two options if you have a dependency like this. In your case, a Form depends on a Service . The first option is to inject dependencies : class Form { protected $service; public function setService(Service $service) { $this->service = $service; } } $form = new Form; $form->setService($service); In this