Bundle/BusinessPageBundle/Controller/BusinessTemplateController.php
public function newAction($id)
    {
        //get the business entity
        $businessEntity = $this->getBusinessEntity($id);

        /** @var BusinessTemplate $view */
        $view = $this->get('victoire_business_page.BusinessTemplate_chain')->getBusinessTemplate($id);
        $view->setBusinessEntityId($businessEntity->getId());

        $form = $this->createCreateForm($view);

        $parameters = [
            'entity' => $view,
            'form'   => $form->createView(),
        ];

        return new JsonResponse([
            'html' => $this->container->get('templating')->render(
                'VictoireBusinessPageBundle:BusinessTemplate:new.html.twig',
                $parameters
            ),
            'success' => true,
        ]);
    }
public function newAction($id)
    {
        //get the business entity
        $businessEntity = $this->getBusinessEntity($id);

        /** @var BusinessTemplate $view */
        $view = $this->get('victoire_business_page.BusinessTemplate_chain')->getBusinessTemplate($id);
        $view->setBusinessEntityId($businessEntity->getId());

        $form = $this->createCreateForm($view);

        $parameters = [
            'entity' => $view,
            'form'   => $form->createView(),
        ];

        return new JsonResponse([
            'html' => $this->container->get('templating')->render(
                'VictoireBusinessPageBundle:BusinessTemplate:new.html.twig',
                $parameters
            ),
            'success' => true,
        ]);
    }
public function newAction ( $ id ) { //get the business entity $ businessEntity = $ this -> getBusinessEntity ( $ id ) ; /** @var BusinessTemplate $view */ $ view = $ this -> get ( 'victoire_business_page.BusinessTemplate_chain' ) -> getBusinessTemplate ( $ id ) ; $ view -> setBusinessEntityId ( $ businessEntity -> getId ( ) ) ; $ form = $ this -> createCreateForm ( $ view ) ; $ parameters = [ 'entity' => $ view , 'form' => $ form -> createView ( ) , ] ; return new JsonResponse ( [ 'html' => $ this -> container -> get ( 'templating' ) -> render ( 'VictoireBusinessPageBundle:BusinessTemplate:new.html.twig' , $ parameters ) , 'success' => true , ] ) ; }
Displays a form to create a new BusinessTemplate entity.

@param string $id The id of the businessEntity

@throws \Exception

@Route("/{id}/new", name="victoire_business_template_new")
@Method("GET")

@return JsonResponse The entity and the form
Displays a form to create a new BusinessTemplate entity .