PHP code example of talesoft / tale-router
1. Go to this page and download the library: Download talesoft/tale-router 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/ */
talesoft / tale-router example snippets
use Tale\App;
use Tale\Router;
$app = new App();
$app->append(Router::class);
$router = $app->get(Router::class);
$router->get('/:controller?/:action?/:id?.:format?', function($request, $response, $next) {
$controller = $request->getAttribute('controller', 'index');
//Handle controller $controller
return $next($request, $response);
});
$app->display();