1
0
mirror of https://github.com/dannyvankooten/AltoRouter.git synced 2025-08-04 15:37:45 +02:00

update docs to make sure is an array

This commit is contained in:
Danny van Kooten
2019-02-19 10:16:08 +01:00
parent 6529ec2ace
commit a1569ad33b

View File

@@ -26,7 +26,7 @@ $router->map( 'GET', '/user/[i:id]/', function( $id ) {
$match = $router->match();
// call closure or throw 404 status
if( $match && is_callable( $match['target'] ) ) {
if( is_array($match) && is_callable( $match['target'] ) ) {
call_user_func_array( $match['target'], $match['params'] );
} else {
// no route was matched