Skip to content

[RFC] Provide event for collecting routes from bundles #343

Closed
@Koc

Description

@Koc

It would be useful if we can add route resources files when enabling bundle in kernel with zero-config changes.

<?php

namespace MyBundle\EventListener;

class RouteCollectionEventListener
{
    public function addRoutes(BuldRouteCollectionEvent $event)
    {
        $event->add('@MyBundle/routing.yml');
        $event->add('@MyBundle/Controller', 'annotation'); // maybe we can also add priority option
    }
}

See https://github.com/modera/ModeraRoutingBundle/blob/master/Routing/Loader.php and https://github.com/modera/ModeraRoutingBundle/blob/master/README.md for similar approach

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions