From 3a97b2c43214db59dc97e2e1965e04b87367b90b Mon Sep 17 00:00:00 2001 From: Danny van Kooten Date: Sun, 10 Nov 2019 20:32:52 +0100 Subject: [PATCH] use short array notation in readme too --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9ef662a..9630cc4 100644 --- a/README.md +++ b/README.md @@ -5,18 +5,18 @@ AltoRouter is a small but powerful routing class, heavily inspired by [klein.php $router = new AltoRouter(); // map homepage -$router->map( 'GET', '/', function() { +$router->map('GET', '/', function() { require __DIR__ . '/views/home.php'; }); // dynamic named route -$router->map( 'GET|POST', '/users/[i:id]/', function( $id ) { +$router->map('GET|POST', '/users/[i:id]/', function($id) { $user = ..... require __DIR__ . '/views/user/details.php'; -}, 'user-details' ); +}, 'user-details'); // echo URL to user-details page for ID 5 -echo $router->generate( 'user-details', array( 'id' => 5 ) ); // Output: "/users/5" +echo $router->generate('user-details', ['id' => 5]); // Output: "/users/5" ``` ## Features