We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
If the first argument of when is an array you can create more customized routes, including multiple comma separated methods.
when
$tipsy->router() ->when([ 'route' => 'update', 'method' => 'post,put', 'controller' => function() { echo 'Updating content...'; } ]);
Here are a few different ways to define the home page using the methods described above.
$tipsy->router() ->when('', function() { echo 'Here I am'; });
is the same as
$tipsy->router() ->when('/', function() { echo 'Here I am'; });
$tipsy->router() ->home(function() { echo 'Here I am'; });
$tipsy->router() ->when([ 'route' => '', 'method' => '*', 'controller' => function() { echo 'Here I am'; } ]);