PHP code example of zf-metal / restful

1. Go to this page and download the library: Download zf-metal/restful 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/ */

    

zf-metal / restful example snippets




return [
    'router' => [
        'routes' => [
            'zfmcErp' => [
                'type' => \Zend\Router\Http\Literal::class,
                'mayTerminate' => false,
                'options' => [
                    'route' => '/custom/api',
                ],
                'child_routes' => [
                    'api' => [
                        'type' => \Zend\Router\Http\Segment::class,
                        'mayTerminate' => false,
                        'options' => [
                            'route' => '/:entityAlias[/:id]',
                            'defaults' => [
                                'controller' => \ZfMetal\Restful\Controller\MainController::class,
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ]
];



return  [
    'zf-metal-restful.options' => [
        'entity_aliases' => [
            'alias' => 'entity_class'
        ]
    ]
];