src/Sulu/Bundle/SnippetBundle/Controller/SnippetAreaController.php
public function deleteAction(Request $request, $key)
    {
        $webspaceKey = $this->getRequestParameter($request, 'webspace', true);
        $this->get('sulu_security.security_checker')->checkPermission(
            new SecurityCondition(SnippetAdmin::getDefaultSnippetsSecurityContext($webspaceKey)),
            PermissionTypes::EDIT
        );

        $areas = $this->getLocalizedAreas();
        $area = $areas[$key];

        $this->get('sulu_snippet.default_snippet.manager')->remove($webspaceKey, $key);

        return new JsonResponse(
            [
                'key' => $key,
                'template' => $area['template'],
                'title' => $area['title'],
                'defaultUuid' => null,
                'defaultTitle' => null,
                'valid' => true,
            ]
        );
    }
public function deleteAction(Request $request, $key)
    {
        $webspaceKey = $this->getRequestParameter($request, 'webspace', true);
        $this->get('sulu_security.security_checker')->checkPermission(
            new SecurityCondition(SnippetAdmin::getDefaultSnippetsSecurityContext($webspaceKey)),
            PermissionTypes::EDIT
        );

        $areas = $this->getLocalizedAreas();
        $area = $areas[$key];

        $this->get('sulu_snippet.default_snippet.manager')->remove($webspaceKey, $key);

        return new JsonResponse(
            [
                'key' => $key,
                'template' => $area['template'],
                'title' => $area['title'],
                'defaultUuid' => null,
                'defaultTitle' => null,
                'valid' => true,
            ]
        );
    }
public function deleteAction ( Request $ request , $ key ) { $ webspaceKey = $ this -> getRequestParameter ( $ request , 'webspace' , true ) ; $ this -> get ( 'sulu_security.security_checker' ) -> checkPermission ( new SecurityCondition ( SnippetAdmin :: getDefaultSnippetsSecurityContext ( $ webspaceKey ) ) , PermissionTypes :: EDIT ) ; $ areas = $ this -> getLocalizedAreas ( ) ; $ area = $ areas [ $ key ] ; $ this -> get ( 'sulu_snippet.default_snippet.manager' ) -> remove ( $ webspaceKey , $ key ) ; return new JsonResponse ( [ 'key' => $ key , 'template' => $ area [ 'template' ] , 'title' => $ area [ 'title' ] , 'defaultUuid' => null , 'defaultTitle' => null , 'valid' => true , ] ) ; }
Delete default action.

@param Request $request
@param string $key

@return JsonResponse
Delete default action .