Skip to content

[Cookbook] [Routing] Article about custom route loaders #2339

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

Merged
merged 4 commits into from
Apr 9, 2013

Conversation

matthiasnoback
Copy link
Contributor

I've created a new cookbook article about custom route loaders (see also #526). Feedback is much appreciated.

There is a small difference for version 2.1:

public function setResolver(LoaderResolver $resolver)

should be changed to

public function setResolver(LoaderResolverInterface $resolver)

As well as the corresponding use at the top.

How should I add this to my pull request?

@matthiasnoback
Copy link
Contributor Author

I noticed the problem with my previous pull request (it was against master) - this is much better...

Creating a Custom Loader
------------------------

To load routes in another way then using annotations, Yaml or XML files,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then => than ?

@matthiasnoback
Copy link
Contributor Author

Thanks for your feedback!

with the given resource (``@AcmeDemoBundle/Controller/DemoController.php``)
and type ("annotation") as arguments. When one of the loader returns ``true``,
its method :method:`Symfony\\Component\\Config\\Loader\\LoaderInterface::load`
will be called, and the loader returns a :class:`Symfony\\Component\\Routing\\RouteCollection`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its method ... gets called in favor of will be called ?

@matthiasnoback
Copy link
Contributor Author

Thanks for the feedback - very good points. I will continue my work on this in a couple of days.

@matthiasnoback
Copy link
Contributor Author

@e-solving Please don't repeat your question somewhere else when an already given answer in another place is not to your satisfaction. Remember that all people involved in this pull request will see your answer too (just like mine in fact ;)) and that it has no business here.

@luisansal
Copy link

I don't repeat the question, my question is why my route new.yml doesn't load the resource... can somebody help me?

@wouterj
Copy link
Member

wouterj commented Mar 28, 2013

@e-solving there are thousands of people who want to help you, but not here. And yes, you are repeating your question. (4 times to be exact)

@cordoval
Copy link
Contributor

@e-solving do it on matthias blog, or on the forum or on the mailing list for users, those are the channels.

@luisansal
Copy link

@wouterj My question is differente isn't how to create a routing.loader class, is that everthing is fine, except when in my news.yml don't load the resource. the problem isn't my custom routing.loader, is why don't load ther resource from the routing, that is all... understand?, @cordoval i did it on matthias blog, but anybody answer... @matthiasnoback please can u see my problem?, can u help me?

@wouterj
Copy link
Member

wouterj commented Mar 28, 2013

@e-solving we understand your question, but we can't answer it here. The places you asked it now (symfony/symfony and symfony/symfony-docs) are repositories where people talk about the core code and the documentation. This is the place were new features will be discussed.
There are other places where people can ask for questions with Symfony.

That way, we can seperate these things so people can watch the places they want to contribute. A lot of people get notifications now, because you asked the question here, but all these people aren't interested in helping people, they are interested in working the documentation. If you ask it on the forum, a lot of people will get notified and they love it: They watched the forum because they want to help people.

@cordoval
Copy link
Contributor

@e-solving si tu respondes en el mailing list te podemos ayudar, pero no aca
Eres de Peru y yo tambien soy de Peru, pero preguntar por aca nos esta dejando mal
hay que quedar bien, incluso hay una lista phpperu en google groups y otra en symfony users mailing

@luisansal
Copy link

@wouterj :O ok i understood, thanks a lot, @cordoval ok entiendo, te puedo escribir al correo, dame una mano con esto vale, por favor, seria de mucha ayuda brother!

i'm so sorry for the inconvenience... :(

@matthiasnoback
Copy link
Contributor Author

I have processed part of your feedback (thanks again!). I was not sure about mentioning other bundles with custom route loaders - is this common practice in the Symfony documentation? Of course some of these bundles are "here to stay", but it adds a bit of instability to this article.

@wouterj
Copy link
Member

wouterj commented Mar 30, 2013

We use more and more references to other bundles and code. I think it's a great way to show the users some use cases and to show them how to implement this in a real Symfony2 application.

@matthiasnoback
Copy link
Contributor Author

@wouterj Fine! Just did that. Good luck today by the way!

@luisansal
Copy link

I will try, the answer, thanks again @matthiasnoback and @wouterj and good luck too!

weaverryan added a commit that referenced this pull request Apr 9, 2013
…ader

[Cookbook] [Routing] Article about custom route loaders
@weaverryan weaverryan merged commit e804e02 into symfony:2.0 Apr 9, 2013
@weaverryan
Copy link
Member

Hey Matthias!

Thanks for adding another very nice entry to the docs! I've proofread this, but made only very minor changes (thanks to everyone else for making the merge so easy).

Cheers!

@matthiasnoback
Copy link
Contributor Author

Thanks for merging!
And thanks to all for your good feedback.

@matthiasnoback matthiasnoback deleted the cookbook_custom_route_loader branch April 10, 2013 07:27
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

Successfully merging this pull request may close these issues.

7 participants