PHP code example of drewm / slim-commander

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

    

drewm / slim-commander example snippets




session_start();

// Instantiate the app
$settings = es
ware.php';

// Register routes



// Instantiate the app
$settings = $settings);

// Set up dependencies
';

// Run app
$app->run($argv);

$app->command('HelloWorld', 'HelloWorld:greet', [
    'name',
]);

class HelloWorld
{
    private $container;

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

    public function greet($args)
    {
        echo "Hello " . $args['name'];
    }
}

$container['HelloWorld'] = function ($container) {
    return new \App\Commands\HelloWorld($container);
};