Skip to content

Commit

Permalink
refactor: use recommended code for service
Browse files Browse the repository at this point in the history
  • Loading branch information
datamweb committed Aug 18, 2024
1 parent 4259b47 commit dea8829
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions user_guide_src/source/incoming/routing/071.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?php

use Config\Services;

// Get the router instance
$router = Services::router();
/**
* Get the router instance
*
* @var \CodeIgniter\Router\Router $router
*/
$router = service('router');

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

0 comments on commit dea8829

Please sign in to comment.