Download the PHP package letkode/data-provider-bundle without Composer
On this page you can find all versions of the php package letkode/data-provider-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download letkode/data-provider-bundle
More information about letkode/data-provider-bundle
Files in letkode/data-provider-bundle
Package data-provider-bundle
Short Description Attribute-driven, namespaced data provider registry and endpoint for Symfony applications
License MIT
Informations about the package data-provider-bundle
letkode/data-provider-bundle
Attribute-driven, namespaced data provider registry and endpoint for Symfony applications.
Allows any service to expose named, aliased method sets under a provider group (a namespace such as form-options, search, reports, etc.), which are then discoverable at runtime through a single REST endpoint. It generalizes the "expose a repository method as an option list" pattern so it can be reused for any read-only, alias-driven data access use case — not just form options.
Installation
Symfony Flex will register the bundle automatically. If not using Flex, add it manually:
Import the routes to expose the endpoint:
Usage
1. Mark a service as a provider
2. Fetch data via the API
3. Reuse the same mechanism for other domains
The providerGroup namespaces providers so unrelated features can reuse the same alias without colliding:
4. Discover providers within a group
How it works
LetkodeDataProviderBundle::build()callsregisterAttributeForAutoconfiguration()so any service annotated with#[DataProvider]is automatically tagged asletkode.data_provider.ProviderRegistrycollects all tagged providers via#[AutowireIterator]and indexes them in three levels:providerGroup → classAlias → methodAlias.DataProviderControllerresolvesproviderGroup+classAlias+methodAliasand returns the result as JSON. Query parameters, if present, are passed as a single array argument to the resolved method.DataProviderControlleralso exposesGET /api/providers/{providerGroup}to list every provider and its exposed methods within a given group, for runtime discovery.
Requirements
- PHP
^8.4 - Symfony
^7.0 || ^8.0
License
MIT — see LICENSE.
All versions of data-provider-bundle with dependencies
symfony/dependency-injection Version ^7.0 || ^8.0
symfony/framework-bundle Version ^7.0 || ^8.0
symfony/routing Version ^7.0 || ^8.0