2017 © Pedro Peláez
 

symfony-bundle woohoolabs-yin-bundle

Implements woohoolabs/yin framework into Symfony

image

qpautrat/woohoolabs-yin-bundle

Implements woohoolabs/yin framework into Symfony

  • Tuesday, February 13, 2018
  • by qpautrat
  • Repository
  • 1 Watchers
  • 2 Stars
  • 2,288 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 9 Versions
  • 27 % Grown

The README.md

QPWoohoolabsYinBundle for Symfony

Latest Version on Packagist, (*1)

This bundle implements woohoolabs/yin library into Symfony framework., (*2)

Note: 5.x is for Yin 4.x, 4.x is for Yin 3.x and 3.x is for Yin 0.11, (*3)

Installation

$ composer require qpautrat/woohoolabs-yin-bundle

Then for Symfony 3.x and before, like for any other bundle, include it in your Kernel class:, (*4)

public function registerBundles()
{
    $bundles = array(
        // ...

        new QP\WoohoolabsYinBundle\QPWoohoolabsYinBundle(),
    );

    // ...
}

Symfony 4+ will automatically register the bundle., (*5)

Configuration

By default jsonApi class is intialized with Yin's ExceptionFactory. You can provide your own factory implementation. To do that you have to define which service to use in your global configuration like this:, (*6)

qp_woohoolabs_yin:
    exception_factory: my_exception_factory_service

Usage

Configure service binding:, (*7)

services:
    _defaults:
        #...
        bind:
            WoohooLabs\Yin\JsonApi\JsonApi: '@qp_woohoolabs_yin.json_api'

Then you can use qp_woohoolabs_yin.json_api service by injecting it in the constructor:, (*8)

namespace App\Controller;

use Psr\Http\Message\ResponseInterface;
use WoohooLabs\Yin\JsonApi\JsonApi;

class DefaultController
{
    /**
     * @var JsonApi
     */
    private $jsonApi;

    public function __construct(JsonApi $jsonApi)
    {
        $this->jsonApi = $jsonApi;
    }

    public function index(): ResponseInterface
    {
        return $this->jsonApi->respond()->ok(new HelloDocument(), 'hello');
    }
}

Or in the action method directly:, (*9)

namespace App\Controller;

use Psr\Http\Message\ResponseInterface;
use WoohooLabs\Yin\JsonApi\JsonApi;

class DefaultController
{
    public function index(JsonApi $jsonApi): ResponseInterface
    {
        return $jsonApi->respond()->ok(new HelloDocument(), 'hello');
    }
}

The Versions

13/02 2018

dev-master

9999999-dev

Implements woohoolabs/yin framework into Symfony

  Sources   Download

MIT

The Requires

 

The Development Requires

by Quentin Pautrat

symfony json-api

13/02 2018

4.0.1

4.0.1.0

Implements woohoolabs/yin framework into Symfony

  Sources   Download

MIT

The Requires

 

The Development Requires

by Quentin Pautrat

symfony json-api

19/01 2018

4.0.0

4.0.0.0

Implements woohoolabs/yin framework into Symfony

  Sources   Download

MIT

The Requires

 

The Development Requires

by Quentin Pautrat

symfony json-api

19/01 2018

3.1.0

3.1.0.0

Implements woohoolabs/yin framework into Symfony

  Sources   Download

MIT

The Requires

 

The Development Requires

by Quentin Pautrat

symfony json-api

19/01 2018

dev-config_ci

dev-config_ci

Implements woohoolabs/yin framework into Symfony

  Sources   Download

MIT

The Requires

 

The Development Requires

by Quentin Pautrat

symfony json-api

03/05 2017

3.0.1

3.0.1.0

Implements woohoolabs/yin framework into Symfony

  Sources   Download

MIT

The Requires

 

The Development Requires

by Quentin Pautrat

symfony json-api

03/05 2017

3.0.0

3.0.0.0

Implements woohoolabs/yin framework into Symfony

  Sources   Download

MIT

The Requires

 

The Development Requires

by Quentin Pautrat

symfony json-api

20/04 2016

2.0.0

2.0.0.0

Implements woohoolabs/yin framework into Symfony

  Sources   Download

MIT

The Requires

 

The Development Requires

by Quentin Pautrat

symfony json-api

23/03 2016

1.0.0

1.0.0.0

Implements woohoolabs/yin framework into Symfony

  Sources   Download

MIT

The Requires

 

The Development Requires

by Quentin Pautrat

json-api