-
Notifications
You must be signed in to change notification settings - Fork 156
Initial version #42
Initial version #42
Conversation
- Have yet to fill out the example of a custom route, as I havn't got round to this myself yet.
Using a custom route repository with Dynmaic Router | ||
=================================================== | ||
|
||
The Dynamic Router allows you to customize the route Repository (i.e. the class responsible for retrieving routes from the database), and by extension, the Route objects. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we try to keep lines broken after 80-100 characters. this makes it easier to read diffs and when somebody fixes a spelling error, you have to scan just one line of < 100 characters to see what changed, instead of the whole section. to rst its all the same, a new section is only started with a blank line.
thanks a lot, good documentation. you need to add a link in the main index in the cookbook section, and i would add links in the cmf tutorial and the routing-extra reference chapters where they make sense to have people notice this cookbook exists. |
class RouteRepository extends DocumentRepository implements RouteRepositoryInterface | ||
|
||
{ | ||
public function findManyByUrl($url) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, really off topic for a doc PR, but what if we would change this to findManyByRequest and pass the whole request? i.e. symfony 2.2 supports hostnamePattern on routes, so we might want to know the hostname that was used in this request...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going to suggest changing it to findByUrl
so as to make it more sensible when only returning one route, but yeah, I think it makes sense to pass in the request. What about "getRouteCollectionForRequest" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
like that name. created a PR - feedback welcome: symfony-cmf/Routing#33
@dantleech can you please change the line breaks and add links? then i think we can merge this PR. |
yeah sure, I will update tomorrow, I guess you realize that its incomplete as I havn't filled out the Route object, will probably get around to that this weekend. |
hi, I've quickly updated. Not sure how to "backlink" to a |
yes, exactly . for example
|
ok . updated and the code example should work now... |
thanks! |
Not sure if this is exactly what you had in mind, but here is an initial version of a cookbook article on implementing a custom route repository -- I need to fill out the example of a custom route, as I havn't actually done this myself yet.