src/Kunstmaan/CacheBundle/Controller/VarnishController.php
public function banAction(Node $node)
    {
        $this->checkPermission();

        /** @var NodeTranslation $nodeTranslation */
        foreach ($node->getNodeTranslations() as $nodeTranslation) {
            $route = $this->generateUrl('_slug', ['url' => $nodeTranslation->getUrl(), '_locale' => $nodeTranslation->getLang()]);
            $this->get('kunstmaan_cache.helper.varnish')->banPath($route);
        }
        $this->addFlash('success', 'kunstmaan_cache.varnish.ban.success');

        return $this->redirect($this->generateUrl('KunstmaanNodeBundle_nodes_edit', ['id' => $node->getId()]));
    }
public function banAction(Node $node)
    {
        $this->checkPermission();

        /** @var NodeTranslation $nodeTranslation */
        foreach ($node->getNodeTranslations() as $nodeTranslation) {
            $route = $this->generateUrl('_slug', ['url' => $nodeTranslation->getUrl(), '_locale' => $nodeTranslation->getLang()]);
            $this->get('kunstmaan_cache.helper.varnish')->banPath($route);
        }
        $this->addFlash('success', 'kunstmaan_cache.varnish.ban.success');

        return $this->redirect($this->generateUrl('KunstmaanNodeBundle_nodes_edit', ['id' => $node->getId()]));
    }
public function banAction ( Node $ node ) { $ this -> checkPermission ( ) ; /** @var NodeTranslation $nodeTranslation */ foreach ( $ node -> getNodeTranslations ( ) as $ nodeTranslation ) { $ route = $ this -> generateUrl ( '_slug' , [ 'url' => $ nodeTranslation -> getUrl ( ) , '_locale' => $ nodeTranslation -> getLang ( ) ] ) ; $ this -> get ( 'kunstmaan_cache.helper.varnish' ) -> banPath ( $ route ) ; } $ this -> addFlash ( 'success' , 'kunstmaan_cache.varnish.ban.success' ) ; return $ this -> redirect ( $ this -> generateUrl ( 'KunstmaanNodeBundle_nodes_edit' , [ 'id' => $ node -> getId ( ) ] ) ) ; }
Ban route from varnish

@Route("/varnish/ban/{node}", name="kunstmaancachebundle_varnish_ban")

@param Node $node

@return RedirectResponse
Ban route from varnish