src/Kunstmaan/CacheBundle/Controller/VarnishController.php
public function indexAction(Request $request)
    {
        $this->checkPermission();

        $form = $this->createForm(BanType::class);

        if ($request->isMethod('POST')) {
            $form->handleRequest($request);

            if ($form->isValid()) {
                $path = $form['path']->getData();

                $this->get('kunstmaan_cache.helper.varnish')->banPath($path, $form['allDomains']->getData());

                $this->addFlash('success', 'kunstmaan_cache.varnish.ban.success');
            }
        }

        return [
            'form' => $form->createView(),
        ];
    }
public function indexAction(Request $request)
    {
        $this->checkPermission();

        $form = $this->createForm(BanType::class);

        if ($request->isMethod('POST')) {
            $form->handleRequest($request);

            if ($form->isValid()) {
                $path = $form['path']->getData();

                $this->get('kunstmaan_cache.helper.varnish')->banPath($path, $form['allDomains']->getData());

                $this->addFlash('success', 'kunstmaan_cache.varnish.ban.success');
            }
        }

        return [
            'form' => $form->createView(),
        ];
    }
public function indexAction ( Request $ request ) { $ this -> checkPermission ( ) ; $ form = $ this -> createForm ( BanType :: class ) ; if ( $ request -> isMethod ( 'POST' ) ) { $ form -> handleRequest ( $ request ) ; if ( $ form -> isValid ( ) ) { $ path = $ form [ 'path' ] -> getData ( ) ; $ this -> get ( 'kunstmaan_cache.helper.varnish' ) -> banPath ( $ path , $ form [ 'allDomains' ] -> getData ( ) ) ; $ this -> addFlash ( 'success' , 'kunstmaan_cache.varnish.ban.success' ) ; } } return [ 'form' => $ form -> createView ( ) , ] ; }
Generates the varnish ban form.

@Route("/settings/varnish", name="kunstmaancachebundle_varnish_settings_ban")
@Template("KunstmaanCacheBundle:Varnish:ban.html.twig")

@param Request $request

@return array
Generates the varnish ban form .