public function createBlockAction(Request $request, $type)
    {
        $entity = new Block();
        $entity->setType($type);
        $form = $this->createBlockCreateForm($entity);
        $form->handleRequest($request);

        $availableLangs = $this->container->getParameter('flowcode_page.available_languages');

        if ($form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $page = $entity->getPage();
            foreach ($availableLangs as $key => $value) {
                $entityLang = new Block();
                $entityLang->setName($entity->getName());
                $entityLang->setLang($key);
                $entityLang->setContent($entity->getContent());
                $entityLang->setPage($entity->getPage());
                $entityLang->setType($type);
                $em->persist($entityLang);
            }


            $em->flush();

            return $this->redirect($this->generateUrl('admin_page_show', array('id' => $page->getId())));
        }

        return array(
            'entity' => $entity,
            'form' => $form->createView(),
        );
    }