wordpress-dispatcher icon indicating copy to clipboard operation
wordpress-dispatcher copied to clipboard

is there a method allow us to use 0 or more parameter in url

Open iwillhappy1314 opened this issue 8 years ago • 0 comments

as following code, I use ([a-z]*) to match 0 or more parameter, and set a default value in the callback variable, the ''/hello/' return a 404 page.

'hello/([a-z]*)' => function($request, $name="xxx"){
        echo "Hello $name";
}

iwillhappy1314 avatar Jul 04 '16 08:07 iwillhappy1314