PHP code example of nigelgreenway / colonel

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

    

nigelgreenway / colonel example snippets




= (new Colonel\HttpKernel(
    



return [
    'debug'  => false,
    'routes' => [
        'DemoBundle' => [
            'hello_world' => [
                'pattern'    => '/your/pattern/{var}',
                'controller' => 'Path\\To\\Class::method',
                'method'     => 'GET',
            ],
        ],
    ],
    'services' => [
        'di' => [
            'Path\\To\\Some\\Dependency' => [
                'class' => 'Path\\To\\Some\\Dependency',
                'arguments' => [
                    'Path\\To\\Some\\Other\\Dependency',
                ],
            ],
            'Path\\To\\Some\\Other\\Dependency' => [
                'class' => 'Path\\To\\Some\\Other\\Dependency',
            ],
        ],
    ],
];