Skip to content

Commit 0cc5dac

Browse files
committed
docs: add docs for only options in routes configuartion
1 parent b793225 commit 0cc5dac

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

docs/customization/route_config.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ $routes->get('login', '\App\Controllers\Auth\LoginController::loginView');
1717
$routes->get('register', '\App\Controllers\Auth\RegisterController::registerView');
1818
```
1919

20+
If you only need a specific route (or a small set of routes), you can use the `only` option instead
21+
22+
```php
23+
service('auth')->routes($routes, ['only' => ['login']]);
24+
```
25+
26+
In this case, you must manage all other routes manually.
27+
2028
After customization, check your routes with the [spark routes](https://codeigniter.com/user_guide/incoming/routing.html#spark-routes) command.
2129

2230
## Change Namespace

docs/quick_start_guide/using_session_auth.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,14 @@ $routes->get('login', '\App\Controllers\Auth\LoginController::loginView');
8989
$routes->get('register', '\App\Controllers\Auth\RegisterController::registerView');
9090
```
9191

92+
If you only need a specific route (or a small set of routes), you can use the `only` option instead
93+
94+
```php
95+
service('auth')->routes($routes, ['only' => ['login']]);
96+
```
97+
98+
In this case, you must manage all other routes manually.
99+
92100
Check your routes with the [spark routes](https://codeigniter.com/user_guide/incoming/routing.html#spark-routes)
93101
command.
94102

0 commit comments

Comments
 (0)