Symfony2 CMF Project

Routing and navigation menu components

cmf.symfony.com

An introduction to the routing and menu components.

Symfony2 routing

Symfony2 CMF routing concept

Solution: First Take



navigation:
    pattern: "/{url}"
    defaults: { _controller: service.controller:indexAction }
    requirements:
        url: .*

Solution: Better

Chain Router



<service id="my_namespace.my_router"
         class="%my_namespace.my_router_class%">
    <tag name="router" priority="300" />
</service>
            

Doctrine Router: Match url

Doctrine Router: Controller Resolvers



interface ControllerResolverInterface
{
    function getController(RouteObjectInterface $document,
                           array &$defaults);
}
            

Routing and Content


Doctrine Router: Generate

Menu


Routing and Content and Menu


Outlook

Conclusions

Github projects

Resources