Comments (4)
@dawehner if you have too much time left after #97 this could be another cleanup. though much less important.
from routing.
In the meantime we abstracted that into http://cgit.drupalcode.org/drupal/tree/core/lib/Drupal/Core/DependencyInjection/Compiler/TaggedHandlersPass.php?id=refs/heads;id2=8.0.x
which allows you to specify a service to collect other services.
This would be the "collector" service:
breadcrumb:
class: Drupal\Core\Breadcrumb\BreadcrumbManager
arguments: ['@module_handler']
tags:
- { name: service_collector, tag: breadcrumb_builder, call: addBuilder }
and then you do something like that in the client service:
forum.breadcrumb.listing:
class: Drupal\forum\Breadcrumb\ForumListingBreadcrumbBuilder
arguments: ['@entity.manager', '@config.factory', '@forum_manager']
tags:
- { name: breadcrumb_builder, priority: 314 }
Do you think that this is something we could even push into symfony itself?
from routing.
@dawehner sorry for the late reply. are you proposing a generic way of doing compiler passes for tags? compiler passes can do all kind of things, but for the standard case of late-and-implicit hooking up services together, this seems a good idea to me. i would propose that to symfony and see if they like the idea. it seems a DX improvement to me. a variant of your proposal would be a generic compiler pass that the bundle can instantiate with the options about the receiving service and its add-method and the tag name - might be a tad more straightforward. (what would happen if we define several service collectors for the same tag?)
from routing.
feel free to ping me in the symfony/symfony issue to help with the discussion, btw.
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.