Skip to content

Commit

Permalink
Merge pull request #5469 from kenjis/fix-docs-routing.rst
Browse files Browse the repository at this point in the history
docs: add sample code in routing.rst
  • Loading branch information
paulbalandan authored Dec 15, 2021
2 parents 0aa4aad + c890ef7 commit 6cd0839
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion user_guide_src/source/incoming/routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,13 @@ This would handle the URL at ``admin/users/list``. Note that options passed to t
At some point, you may want to group routes for the purpose of applying filters or other route
config options like namespace, subdomain, etc. Without necessarily needing to add a prefix to the group, you can pass
an empty string in place of the prefix and the routes in the group will be routed as though the group never existed but with the
given route config options.
given route config options::

$routes->group('', ['namespace' => 'Myth\Auth\Controllers'], static function ($routes) {
$routes->get('login', 'AuthController::login', ['as' => 'login']);
$routes->post('login', 'AuthController::attemptLogin');
$routes->get('logout', 'AuthController::logout');
});

Environment Restrictions
========================
Expand Down

0 comments on commit 6cd0839

Please sign in to comment.