public function listAction()
    {
        $repository = $this->get('phlexible_media_template.template_manager');

        $allTemplates = $repository->findAll();

        $templates = [];
        foreach ($allTemplates as $template) {
            if (substr($template->getKey(), 0, 4) === '_mm_') {
                continue;
            }

            $templates[] = [
                'key' => $template->getKey(),
                'type' => $template->getType(),
            ];
        }

        return new JsonResponse(['templates' => $templates]);
    }
public function listAction()
    {
        $repository = $this->get('phlexible_media_template.template_manager');

        $allTemplates = $repository->findAll();

        $templates = [];
        foreach ($allTemplates as $template) {
            if (substr($template->getKey(), 0, 4) === '_mm_') {
                continue;
            }

            $templates[] = [
                'key' => $template->getKey(),
                'type' => $template->getType(),
            ];
        }

        return new JsonResponse(['templates' => $templates]);
    }
public function listAction ( ) { $ repository = $ this -> get ( 'phlexible_media_template.template_manager' ) ; $ allTemplates = $ repository -> findAll ( ) ; $ templates = [ ] ; foreach ( $ allTemplates as $ template ) { if ( substr ( $ template -> getKey ( ) , 0 , 4 ) === '_mm_' ) { continue ; } $ templates [ ] = [ 'key' => $ template -> getKey ( ) , 'type' => $ template -> getType ( ) , ] ; } return new JsonResponse ( [ 'templates' => $ templates ] ) ; }
List mediatemplates.

@return JsonResponse
@Route("/list", name="mediatemplates_templates_list")
List mediatemplates .