1. Go to this page and download the library: Download mikescott/emissary 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/ */
Slim\App;
use Slim\Container;
$app = new App(new Container());
$app->add(new \mikescott\Emissary\Middleware([
'foo\Example\ServiceProvider'
]));
$app->get('/', function ($request, $response, $args) {
$response->write($this->get('example')->hello());
return $response;
});
$app->run();
namespace foo\Example;
class Example {
public function hello()
{
return "Hello, world!";
}
}
namespace foo\Example;
class ServiceProvider extends \Illuminate\Support\ServiceProvider {
public function register()
{
$this->app->singleton('example', function($app) {
return new Example();
});
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.