X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2FPathRouter.php;h=049b32f64e3bc9b5f4c6355b53f462fa50573142;hp=005c34138c3efbd8d1a1b3be56f00857e243e021;hb=9964ca1a390c446397dcd466916ffed356cdc3c9;hpb=ae69acacf567077b3f49d1fe6c3f3770e72a9093 diff --git a/includes/PathRouter.php b/includes/PathRouter.php index 005c34138c..049b32f64e 100644 --- a/includes/PathRouter.php +++ b/includes/PathRouter.php @@ -27,20 +27,20 @@ * * $router->add( "/wiki/$1" ); * - Matches /wiki/Foo style urls and extracts the title - * $router->add( array( 'edit' => "/edit/$key" ), array( 'action' => '$key' ) ); + * $router->add( [ 'edit' => "/edit/$key" ], [ 'action' => '$key' ] ); * - Matches /edit/Foo style urls and sets action=edit * $router->add( '/$2/$1', - * array( 'variant' => '$2' ), - * array( '$2' => array( 'zh-hant', 'zh-hans' ) + * [ 'variant' => '$2' ], + * [ '$2' => [ 'zh-hant', 'zh-hans' ] ] * ); * - Matches /zh-hant/Foo or /zh-hans/Foo - * $router->addStrict( "/foo/Bar", array( 'title' => 'Baz' ) ); + * $router->addStrict( "/foo/Bar", [ 'title' => 'Baz' ] ); * - Matches /foo/Bar explicitly and uses "Baz" as the title - * $router->add( '/help/$1', array( 'title' => 'Help:$1' ) ); + * $router->add( '/help/$1', [ 'title' => 'Help:$1' ] ); * - Matches /help/Foo with "Help:Foo" as the title - * $router->add( '/$1', array( 'foo' => array( 'value' => 'bar$2' ) ); + * $router->add( '/$1', [ 'foo' => [ 'value' => 'bar$2' ] ] ); * - Matches /Foo and sets 'foo' to 'bar$2' without $2 being replaced - * $router->add( '/$1', array( 'data:foo' => 'bar' ), array( 'callback' => 'functionname' ) ); + * $router->add( '/$1', [ 'data:foo' => 'bar' ], [ 'callback' => 'functionname' ] ); * - Matches /Foo, adds the key 'foo' with the value 'bar' to the data array * and calls functionname( &$matches, $data ); * @@ -56,7 +56,7 @@ * - The default behavior is equivalent to `array( 'title' => '$1' )`, * if you don't want the title parameter you can explicitly use `array( 'title' => false )` * - You can specify a value that won't have replacements in it - * using `'foo' => array( 'value' => 'bar' );` + * using `'foo' => [ 'value' => 'bar' ];` * * Options: * - The option keys $1, $2, etc... can be specified to restrict the possible values