Skip to content

Commit 6cd0839

Browse files
authored
Merge pull request #5469 from kenjis/fix-docs-routing.rst
docs: add sample code in routing.rst
2 parents 0aa4aad + c890ef7 commit 6cd0839

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

user_guide_src/source/incoming/routing.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,13 @@ This would handle the URL at ``admin/users/list``. Note that options passed to t
259259
At some point, you may want to group routes for the purpose of applying filters or other route
260260
config options like namespace, subdomain, etc. Without necessarily needing to add a prefix to the group, you can pass
261261
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
262-
given route config options.
262+
given route config options::
263+
264+
$routes->group('', ['namespace' => 'Myth\Auth\Controllers'], static function ($routes) {
265+
$routes->get('login', 'AuthController::login', ['as' => 'login']);
266+
$routes->post('login', 'AuthController::attemptLogin');
267+
$routes->get('logout', 'AuthController::logout');
268+
});
263269

264270
Environment Restrictions
265271
========================

0 commit comments

Comments
 (0)