Skip to content

Commit dea8829

Browse files
committed
refactor: use recommended code for service
1 parent 4259b47 commit dea8829

File tree

1 file changed

+6
-5
lines changed
  • user_guide_src/source/incoming/routing

1 file changed

+6
-5
lines changed

user_guide_src/source/incoming/routing/071.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<?php
2-
3-
use Config\Services;
4-
5-
// Get the router instance
6-
$router = Services::router();
2+
/**
3+
* Get the router instance
4+
*
5+
* @var \CodeIgniter\Router\Router $router
6+
*/
7+
$router = service('router');
78

89
// Retrieve the fully qualified class name of the controller handling the current request.
910
$controller = $router->controllerName();

0 commit comments

Comments
 (0)