1. Go to this page and download the library: Download aol/atc 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/ */
aol / atc example snippets
$router->addGet('Index', '/');
namespace Your\Namespace\Prefix;
class Index extends \Aol\Atc\Action
{
public function __invoke(Request $request)
{
return Response::create('Hello world');
}
}
$router->addGet('Index', '/{name}/');
class Index extends \Aol\Atc\Action
{
public function __invoke(Request $request)
{
return Response::create('Hello ' . $this->params['name']);
}
}
class Index extends \Aol\Atc\Action
{
protected $allowed_formats = ['text/html'];
protected $view = 'index';
public function __invoke(Request $request)
{
return ['name' => $this->params['name']];
}
}