Comments (3)
It would be useful if the extraArgs
overwrote the Injector when looking for a matching class instance. If there was already a XYZ class in the ServiceContainer, providing a new instance of XYZ to extraArgs would prefer to use this one.
This means we could provide one of two things:
- provide a default instance of the
ComponentBinder
so when there's no specific instance provided, an exception is thrown saying something like "A ComponentBinder can only be used within a Component element's go/do functions". - Rename the
DocumentBinder
completely to just be aBinder
... then theBinder
itself can be overridden when in the context of a Component.
from servicecontainer.
I like how just using a Binder
everywhere enforces encapsulation, but maybe some components should be able to bind data outside of their own component element? Maybe? Maybe not... maybe they should just have access to the HTMLDocument if they need to be heavy handed with their encapsulation... (?)
from servicecontainer.
More details on the above at PhpGt/DomTemplate#470
from servicecontainer.
Related Issues (17)
- Make PSR-11 compatible HOT 1
- Exposing lazy-loaded interfaces HOT 1
- Extendable class for returning lazy loadable callbacks
- Lazy Load - no argument necessary if return type specified
- Allow getting nullable type
- Chained loaders HOT 1
- Generic Container::get()
- Nullable objects in webengine go functions are not found HOT 1
- Dependabot
- Allow setting multiple services at once in set()
- No need for LazyLoad if the function name starts with "load" HOT 1
- Upgrade ServiceContainer CI + Matrix builds
- Document ServiceContainer
- Methods without a return type should be ignored
- Should the ServiceContainer allow the app to overload default extension classes?
- `Container::getNullable(string $id)` for getting a nullable service
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 servicecontainer.