PHP code example of reliv / pipe-rat

1. Go to this page and download the library: Download reliv/pipe-rat library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

reliv / pipe-rat example snippets


    'xxx' => [
        'controllerServiceName' => 'Reliv\PipeRat\Middleware\ResourceController\DoctrineResourceController',
        'controllerServiceOptions' => [
            'entity' => null,
        ],
        'methods' => [
            'findById' => [
                'postServiceNames' => [
                    'extractor' => 'Reliv\PipeRat\Middleware\Extractor\PropertyGetterExtractor',
                    'responseHeaders' => 'Reliv\PipeRat\Middleware\Header\AddResponseHeaders',
                ],
                'postServiceOptions' => [
                     'responseHeaders' => [
                          'headers' => [
                              'My' => 'header'
                          ]
                      ]
                ],
            ],
        ],
        'preServiceOptions' => [
        ],
        'preServicePriority' => [
            // 'JsonRequestFormat' => 1000,
        ],
        'postServiceNames' => [
            'responseHeaders' => 'Reliv\PipeRat\Middleware\Header\AddResponseHeaders',
            'JsonResponseFormat' => 'Reliv\PipeRat\Middleware\ResponseFormat\JsonResponseFormat',
            'XmlResponseFormat' => 'Reliv\PipeRat\Middleware\ResponseFormat\XmlResponseFormat',
            'DefaultResponseFormat' => 'Reliv\PipeRat\Middleware\ResponseFormat\JsonResponseFormat',
        ],
        'postServiceOptions' => [
            'DefaultResponseFormat' => [
                'accepts' => [
                    '*/*'
                ],
            ],
        ],
    ]