Comments (11)
you could also build that logic into the enhancer instances. having it in DynamicRouter makes things more complicated - but might gain some performance by not calling too many enhancers.
from routing.
actually the mappers do not really have to run in the context of the DynamicRouter .. they could just as well run after. then again they would then also run for static routes, where they make less sense.
from routing.
indeed with @Crell we discussed the idea of having a generic "route enhancement" step somewhere that adds information to the chosen route based on whatever. and the drupal people where thinking a lot about how to not call too many listeners unnecessarily. maybe he has some input here?
from routing.
I don't know what controller mappers by subpath means, so it's hard to say. :-) My current best thought on the subject is best written up in how we're likely going to do access control: http://drupal.org/node/1793520#comment-6645440
Basically, when a route is being collected and stored for later lookup, we run a processing step on it that lets any system decide if they will care about the route on a request event. Then on request events, the matcher passes the full Route object back as a request attribute, and a mediator listener of some sort looks at that derived information on the route and passes the route off to those systems that indicated they would want to know about it.
I don't know if that's at all related to what you're discussing here, but it's my best guess as it looks like I'm coming in the middle of a conversation.
from routing.
@Crell the job of the Routing system is to 1) match a route and then 2) add attribute values to the Request instance, so that the controller resolver can do its thing, which for the most part means setting _controller
. The concept of "mappers" in the routing is to infer this data from the route (and its attached content) that matched via the DynamicRouter and then set attributes. So mappers take care of step 2), after the RouteRepository took care of 1).
from routing.
I would like to call this Route enhancer and allow any kind of coded logic that changes or adds to the route array.
----- Reply message -----
Von: "Lukas Kahwe Smith" [email protected]
An: "symfony-cmf/Routing" [email protected]
Cc: "David Buchmann" [email protected]
Betreff: [Routing] add a controller mapper by (sub)path (#28)
Datum: Fr., Okt. 26, 2012 09:11
@Crell the job of the Routing system is to 1) match a route and then 2) add attribute values to the Request instance, so that the controller resolver can do its thing, which for the most part means setting _controller. The concept of "mappers" in the routing is to infer this data from the route (and its attached content) that matched via the DynamicRouter and then set attributes. So mappers take care of step 2), after the RouteRepository took care of 1).
—
Reply to this email directly or view it on GitHub.
from routing.
we now have the generic RouteEnhancer - you could write one that is configured with a sub path to do what you need.
from routing.
@lsmith77 do you have a specific use case for this? anyway i think it can be added when we actually need it somewhere, should not pose architectural problems, right?
from routing.
no .. and so its likely also not so important.
from routing.
do we want to keep this open? i think what could make sense is to have a way to configure a DynamicRouter at a sub-path, so having a prefix for all routes this one tries to match. like "/cmf/my/route" would be resolved as "/my/route" by the dynamic router.
then you can solve this issue with such a router and configure it with specific enhancers.
from routing.
i think it would be good to keep it open .. but improve the description.
from routing.
Related Issues (20)
- Create content_on_method enhancer HOT 28
- Issues with conditional enhancer HOT 4
- No Deprication HOT 5
- New File Structure
- Upgrade File
- The router fails to match unicode uri HOT 5
- Attempted to load interface "ChainedRouterInterface" from namespace "Symfony\Cmf\Component\Routing". HOT 5
- Candidates::determineLocale regex matches wrongly HOT 4
- Does dynamic router works on application redirects? HOT 2
- Print dynamic routes on router:debug HOT 2
- Uninitialised requestContext leads to "Call to a member function setParameter() on null -- in LocaleListener.php" HOT 1
- fix latest 1.x HOT 1
- Wrong type hint for ChainRouter::generate HOT 3
- Redirect routes with trailing slash HOT 7
- Symfony Route is not loaded from dumped file HOT 2
- User Deprecated: Since symfony/event-dispatcher 5.1: Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy is deprecated, use the event dispatcher without the proxy. HOT 3
- split into symfony-cmf/chain-router and symfony-cmf/dynamic-router HOT 4
- simplify the dynamic router HOT 4
- TypeError for LazyRouteCollection::all() when inner route provider returns generator from getRoutesByNames() HOT 1
- Potential security issue HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from routing.