<?php
/**
 * Zend Framework (http://framework.zend.com/)
 *
 * @link      http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
 * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
 * @license   http://framework.zend.com/license/new-bsd New BSD License
 */

namespace Application\Controller;

use Application\Entity\Group;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;

class GroupController extends AbstractActionController
{
    public function indexAction()
    {
        return new ViewModel();
    }

    public function createAction()
    {
        /** @var \Zend\Form\Form $groupEntity */
        $groupForm = $this->getServiceLocator()->get('Application\Form\Group');
        $groupEntity = new Group();
        $groupForm->bind($groupEntity);

        if ($this->getRequest()->isPost()) {
            $groupForm->setData($this->getRequest()->getPost());
            if ($groupForm->isValid()) {
                $entityManager = $this->getServiceLocator()
                    ->get('Doctrine\ORM\EntityManager');
                $entityManager->persist($groupEntity);
                $entityManager->flush();
                return $this->redirect()->toRoute('group');
            }
        }


        return new ViewModel(['groupForm' => $groupForm]);
    }
}

<?php
/**
 * Zend Framework (http://framework.zend.com/)
 *
 * @link      http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
 * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
 * @license   http://framework.zend.com/license/new-bsd New BSD License
 */

namespace Application\Controller;

use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;

class GroupController extends AbstractActionController
{
    public function indexAction()
    {
        return new ViewModel();
    }

    public function createAction()
    {
        $form = $this->getServiceLocator()->get('Application\Form\Group');

        return new ViewModel(['groupForm' => $form]);
    }
}

--- 
+++ 
@@ -9,6 +9,7 @@
 
 namespace Application\Controller;
 
+use Application\Entity\Group;
 use Zend\Mvc\Controller\AbstractActionController;
 use Zend\View\Model\ViewModel;
 
@@ -21,8 +22,23 @@
 
     public function createAction()
     {
-        $form = $this->getServiceLocator()->get('Application\Form\Group');
+        /** @var \Zend\Form\Form $groupEntity */
+        $groupForm = $this->getServiceLocator()->get('Application\Form\Group');
+        $groupEntity = new Group();
+        $groupForm->bind($groupEntity);
 
-        return new ViewModel(['groupForm' => $form]);
+        if ($this->getRequest()->isPost()) {
+            $groupForm->setData($this->getRequest()->getPost());
+            if ($groupForm->isValid()) {
+                $entityManager = $this->getServiceLocator()
+                    ->get('Doctrine\ORM\EntityManager');
+                $entityManager->persist($groupEntity);
+                $entityManager->flush();
+                return $this->redirect()->toRoute('group');
+            }
+        }
+
+
+        return new ViewModel(['groupForm' => $groupForm]);
     }
 }
Handle form in group controller
