popshack / silex-hal-serviceprovider
A Silex Service Provider for the HAL library
This package's canonical repository appears to be gone and the package has been frozen as a result.
Requires
- php: >=5.3.0
- nocarrier/hal: dev-master
Requires (Dev)
- pdepend/pdepend: *
- phpmd/phpmd: >=1.4.0
- phpunit/phpunit: >=3.7.1
- silex/silex: 1.0.*@dev
- squizlabs/php_codesniffer: 1.*
- zerkalica/php-code-browser: dev-master
This package is not auto-updated.
Last update: 2021-02-14 21:17:33 UTC
README
A service provider for Silex to improve dependency injection when using the HAL library.
Registering the provider
<?php use \Silex\Application; use \Popshack\Silex\Provider\Hal\HalServiceProvider; $app = new Application(); $app->register(new HalServiceProvider());
You can now use this in your controllers to obtain a Hal instance:
$app->get('/hello', function () use ($app) { $hal = $app['hal']('/orders'); return $hal->asJson(); });
Installation
Installation is using Composer. The preferred method of installation is via packagist as this provides the PSR-0 autoloader functionality. The following composer.json will download and install the latest version of of the provider and dependencies into your project.
{ "require": { "popshack/silex-hal-serviceprovider": "dev-master" }, "minimum-stability": "dev" }
Alternatively, clone the project and install into your project manually.
License
Popshack\Silex\Provider\Hal is licensed under the MIT license.