Bundle/BusinessPageBundle/Controller/BusinessTemplateController.php
public function indexAction()
    {
        $businessEntityHelper = $this->get('victoire_core.helper.business_entity_helper');

        //services
        $em = $this->get('doctrine.orm.entity_manager');

        //the repository
        $repository = $em->getRepository('VictoireBusinessPageBundle:BusinessTemplate');

        $BusinessTemplates = [];

        $businessEntities = $businessEntityHelper->getBusinessEntities();

        foreach ($businessEntities as $businessEntity) {
            $name = $businessEntity->getName();

            //retrieve the pagePatterns
            $pagePatterns = $repository->findPagePatternByBusinessEntity($businessEntity);

            $BusinessTemplates[$name] = $pagePatterns;
        }

        return new JsonResponse([
                'html' => $this->container->get('templating')->render(
                    'VictoireBusinessPageBundle:BusinessEntity:index.html.twig',
                    [
                        'businessEntities'  => $businessEntities,
                        'BusinessTemplates' => $BusinessTemplates,
                    ]
                ),
                'success' => true,
            ]);
    }
public function indexAction()
    {
        $businessEntityHelper = $this->get('victoire_core.helper.business_entity_helper');

        //services
        $em = $this->get('doctrine.orm.entity_manager');

        //the repository
        $repository = $em->getRepository('VictoireBusinessPageBundle:BusinessTemplate');

        $BusinessTemplates = [];

        $businessEntities = $businessEntityHelper->getBusinessEntities();

        foreach ($businessEntities as $businessEntity) {
            $name = $businessEntity->getName();

            //retrieve the pagePatterns
            $pagePatterns = $repository->findPagePatternByBusinessEntity($businessEntity);

            $BusinessTemplates[$name] = $pagePatterns;
        }

        return new JsonResponse([
                'html' => $this->container->get('templating')->render(
                    'VictoireBusinessPageBundle:BusinessEntity:index.html.twig',
                    [
                        'businessEntities'  => $businessEntities,
                        'BusinessTemplates' => $BusinessTemplates,
                    ]
                ),
                'success' => true,
            ]);
    }
public function indexAction ( ) { $ businessEntityHelper = $ this -> get ( 'victoire_core.helper.business_entity_helper' ) ; //services $ em = $ this -> get ( 'doctrine.orm.entity_manager' ) ; //the repository $ repository = $ em -> getRepository ( 'VictoireBusinessPageBundle:BusinessTemplate' ) ; $ BusinessTemplates = [ ] ; $ businessEntities = $ businessEntityHelper -> getBusinessEntities ( ) ; foreach ( $ businessEntities as $ businessEntity ) { $ name = $ businessEntity -> getName ( ) ; //retrieve the pagePatterns $ pagePatterns = $ repository -> findPagePatternByBusinessEntity ( $ businessEntity ) ; $ BusinessTemplates [ $ name ] = $ pagePatterns ; } return new JsonResponse ( [ 'html' => $ this -> container -> get ( 'templating' ) -> render ( 'VictoireBusinessPageBundle:BusinessEntity:index.html.twig' , [ 'businessEntities' => $ businessEntities , 'BusinessTemplates' => $ BusinessTemplates , ] ) , 'success' => true , ] ) ; }
List all business entity page pattern.

@Route("/", name="victoire_business_template_index")

@return JsonResponse
List all business entity page pattern .