madd / silex-fractal-service-provider
A Silex Service Provider for Fractal
Installs: 20
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/madd/silex-fractal-service-provider
Requires (Dev)
- league/fractal: 0.5.*
- league/phpunit-coverage-listener: ~1.1
- silex/silex: ~1.0
This package is not auto-updated.
Last update: 2024-09-24 01:53:31 UTC
README
Fractal Service Provider for Silex
Install
Via Composer
{
"require": {
"madd/silex-fractal-service-provider": "dev-master"
}
}
Usage
use League\Fractal\Collection; /** * You can set the scope identifier that Fractal uses to get its embeds here. * If not set here, it will default to 'embed' */ $app->register(new Madd\Silex\Provider\Fractal\FractalServiceProvider, array( 'fractal.scope_identifier' => 'embed' )); $resource = new Collection($model, new ModelTransformer); $data = $app['fractal']->createData($resource); print_r($data->toArray());
TODO
Note: The build is only passing because I have a test that only tests if true is true.. I still have to implement tests.
- Unit test to fuck
Testing
$ phpunit
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.