sopinet / apihelper-bundle
Symfony2 Bundle - API short and fast usual render
Installs: 525
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 7
Forks: 4
Open Issues: 2
Type:symfony-bundle
Requires
- php: >=5.5.9
- friendsofsymfony/rest-bundle: 2.1.1
This package is not auto-updated.
Last update: 2025-01-04 20:36:33 UTC
README
Symfony2 Bundle - API short and fast usual render
Installation
Composer
Write in terminal:
composer require sopinet/apihelper-bundle "1.0"
AppKernel
Enable the Bundle, Add to Kernel:
// app/AppKernel.php
// ...
class AppKernel extends Kernel
{
// ...
public function registerBundles()
{
$bundles = array(
// ...
new Sopinet\ApiHelperBundle\SopinetApiHelperBundle(),
new FOS\RestBundle\FOSRestBundle(),
new JMS\SerializerBundle\JMSSerializerBundle(),
);
// ...
}
}
Add to config
Configure FOSRestAPI:
fos_rest:
routing_loader:
default_format: json
Bundle dependency
Remember, this bundle has another bundles dependency:
https://github.com/schmittjoh/JMSSerializerBundle
https://github.com/FriendsOfSymfony/FOSRestBundle
Configuration about these bundles was included. If you have any problem with configuration, please, review official documentation about these bundles.
Use
use SopinetApiHelperBundle\Services\ApiHelper;
$apiHelper = $this->get('sopinet_apihelperbundle_apihelper');
...
return $apiHelper->responseOk();
TODO: More Documentation