Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loader not called #56

Open
dschenck opened this issue Sep 23, 2015 · 6 comments
Open

Loader not called #56

dschenck opened this issue Sep 23, 2015 · 6 comments

Comments

@dschenck
Copy link

Hi,

Pulled a fresh Symfony 2.7.4 and added consolebundle
The routing is not added.

Bundle works if you add routing manually via import in app/config/routing.yml so the services are loaded.

I threw an error in the CoreSphere\ConsoleBundle\Routing\Loader -> load() method (threw 1/0), the error was not raised... so is this method called at all?. Any idea why routing not added?

@laszlokorte
Copy link
Member

I guess that's an error in the readme file. @TomasVotruba wanted to change the bundle to load the routes automagically but I just read on http://symfony.com/doc/current/cookbook/routing/custom_route_loader.html that you still need to add

console:
    resource: .
    type: extra

to your routing_dev.yml

@dschenck
Copy link
Author

Ok, confirmed.

Perhaps it would be better to revert to the old import method? I am note sure what the benefits of this loading method has over

_console:
    resource: "@CoreSphereConsoleBundle/Resources/config/routing.yml"

It surely adds a layer of (unwarranted?) complexity - or at least, it obscures the routes.

On a side note, @TomasVotruba I guess the CoreSphereConsoleExtension -> prepend() doesn't work then for routing?

@laszlokorte
Copy link
Member

It seems like the prepending works just for "normal" config values but not for routes.
If this is the case I agree we should revert the change because the old way to include the routes looks simpler.

@TomasVotruba
Copy link
Contributor

I'd rather add:

console:
    resource: .
    type: extra

to README.md, since it might be used by other packages or modular routing for controllers.

@laszlokorte
Copy link
Member

(I have already fixed the readme for now)

the "extra" label seems pretty arbitrary to me - like an artifact from following the example code. shouldn't it be renamed to something more bundle specific like "console" or "coresphere" or "coresphere_console"?
Other bundles may use the "extra" label as well and then I am not able to distinguish which routes I want to load.

@TomasVotruba
Copy link
Contributor

Thanks.

I don't have any knowledge about "extra" key meaning, so feel free to adjust as needed.
If it's something package specific, "coresphere_console" would be fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants