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

Allow to assemble URL with route #42

Closed
bakura10 opened this issue May 20, 2013 · 0 comments
Closed

Allow to assemble URL with route #42

bakura10 opened this issue May 20, 2013 · 0 comments
Milestone

Comments

@bakura10
Copy link
Member

Currently the "assemble" method of the route is missing. This is absolutely needed to generate URLs, but this is not as easy to do, because only the root route is defined in config, and others are just "guessed", so that kind of things $this->url('/users/tweets', array('user_id' => 3, 'tweet_id' => 5) cannot work because only the /users route is defined.

Some syntax like $this->url('/users', array('user_id' => 4)) are tempting, and can be used to generate URL for /users/4, /users/4/tweets/5 (with $this->url('/users', array('user_id' => 4, 'tweet_id' => 5)), but URL for a collection like /users/4/tweets cannot be generated.

Another solution would be to programmatically add new route as we discover them, but I don't really like this solution.

The way that ZF 2 router is made make this more complicated than it seems, and I really want a simple syntax (as the URL helper is mainly used in view helpers... the syntax must not be super-complex).

@Ocramius Ocramius modified the milestones: 0.4.0, 0.1.0 Jul 17, 2014
@bakura10 bakura10 closed this as completed Feb 6, 2015
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

2 participants