src/Kunstmaan/NodeBundle/Controller/WidgetsController.php
private function getTemplateParameters(Request $request)
    {
        // When the media bundle is available, we show a link in the header to the media chooser
        $allBundles = $this->getParameter('kernel.bundles');
        $mediaChooserLink = null;

        if (array_key_exists('KunstmaanMediaBundle', $allBundles)) {
            $params = ['linkChooser' => 1];
            $cKEditorFuncNum = $request->get('CKEditorFuncNum');
            if (!empty($cKEditorFuncNum)) {
                $params['CKEditorFuncNum'] = $cKEditorFuncNum;
            }
            $mediaChooserLink = $this->generateUrl(
                'KunstmaanMediaBundle_chooser',
                $params
            );
        }

        return [
            'mediaChooserLink' => $mediaChooserLink,
        ];
    }
private function getTemplateParameters(Request $request)
    {
        // When the media bundle is available, we show a link in the header to the media chooser
        $allBundles = $this->getParameter('kernel.bundles');
        $mediaChooserLink = null;

        if (array_key_exists('KunstmaanMediaBundle', $allBundles)) {
            $params = ['linkChooser' => 1];
            $cKEditorFuncNum = $request->get('CKEditorFuncNum');
            if (!empty($cKEditorFuncNum)) {
                $params['CKEditorFuncNum'] = $cKEditorFuncNum;
            }
            $mediaChooserLink = $this->generateUrl(
                'KunstmaanMediaBundle_chooser',
                $params
            );
        }

        return [
            'mediaChooserLink' => $mediaChooserLink,
        ];
    }
private function getTemplateParameters ( Request $ request ) { // When the media bundle is available, we show a link in the header to the media chooser $ allBundles = $ this -> getParameter ( 'kernel.bundles' ) ; $ mediaChooserLink = null ; if ( array_key_exists ( 'KunstmaanMediaBundle' , $ allBundles ) ) { $ params = [ 'linkChooser' => 1 ] ; $ cKEditorFuncNum = $ request -> get ( 'CKEditorFuncNum' ) ; if ( ! empty ( $ cKEditorFuncNum ) ) { $ params [ 'CKEditorFuncNum' ] = $ cKEditorFuncNum ; } $ mediaChooserLink = $ this -> generateUrl ( 'KunstmaanMediaBundle_chooser' , $ params ) ; } return [ 'mediaChooserLink' => $ mediaChooserLink , ] ; }
Get the parameters needed in the template. This is common for the
default link chooser and the cke link chooser.

@param \Symfony\Component\HttpFoundation\Request $request

@return array
Get the parameters needed in the template . This is common for the default link chooser and the cke link chooser .