public function nodeRouteAction(NodeRoute $nodeRoute)
    {

        if($node = $this->get('mm_cmf_routing.node_resolver')->resolve($nodeRoute)) {

            if ($nodeRoute instanceof RedirectNodeRoute) {
                return $this->redirectAction($nodeRoute);
            } else {

                if ($nodeRoute->getNode() instanceof TemplatableNodeInterface) {

                    $response = $this->render(
                        $this->get('mm_cmf_content.template_manager')->getTemplate($nodeRoute->getNode()),
                        array(
                            'node' => $nodeRoute->getNode(),
                            'route' => $nodeRoute
                        )
                    );

                    /**
                     * should be configurable
                     * cache for 1800 seconds
                     */
                    $response->setSharedMaxAge(1800);

                    // (optional) set a custom Cache-Control directive
                    $response->headers->addCacheControlDirective('must-revalidate', true);

                    return $response;

                } else {
                    throw new NotFoundHttpException();
                }
            }
        } else {
            throw new NotFoundHttpException();
        }
    }
public function nodeRouteAction(NodeRoute $nodeRoute)
    {

        if($node = $this->get('mm_cmf_routing.node_resolver')->resolve($nodeRoute)) {

            if ($nodeRoute instanceof RedirectNodeRoute) {
                return $this->redirectAction($nodeRoute);
            } else {

                if ($nodeRoute->getNode() instanceof TemplatableNodeInterface) {

                    $response = $this->render(
                        $this->get('mm_cmf_content.template_manager')->getTemplate($nodeRoute->getNode()),
                        array(
                            'node' => $nodeRoute->getNode(),
                            'route' => $nodeRoute
                        )
                    );

                    /**
                     * should be configurable
                     * cache for 1800 seconds
                     */
                    $response->setSharedMaxAge(1800);

                    // (optional) set a custom Cache-Control directive
                    $response->headers->addCacheControlDirective('must-revalidate', true);

                    return $response;

                } else {
                    throw new NotFoundHttpException();
                }
            }
        } else {
            throw new NotFoundHttpException();
        }
    }
public function nodeRouteAction ( NodeRoute $ nodeRoute ) { if ( $ node = $ this -> get ( 'mm_cmf_routing.node_resolver' ) -> resolve ( $ nodeRoute ) ) { if ( $ nodeRoute instanceof RedirectNodeRoute ) { return $ this -> redirectAction ( $ nodeRoute ) ; } else { if ( $ nodeRoute -> getNode ( ) instanceof TemplatableNodeInterface ) { $ response = $ this -> render ( $ this -> get ( 'mm_cmf_content.template_manager' ) -> getTemplate ( $ nodeRoute -> getNode ( ) ) , array ( 'node' => $ nodeRoute -> getNode ( ) , 'route' => $ nodeRoute ) ) ; /**
                     * should be configurable
                     * cache for 1800 seconds
                     */ $ response -> setSharedMaxAge ( 1800 ) ; // (optional) set a custom Cache-Control directive $ response -> headers -> addCacheControlDirective ( 'must-revalidate' , true ) ; return $ response ; } else { throw new NotFoundHttpException ( ) ; } } } else { throw new NotFoundHttpException ( ) ; } }
process the the node route call
@param NodeRoute $nodeRoute
@return \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
@throws NotFoundHttpException
process the the node route call