From bd363d072594adba54f4bfd162c21ff55a31dedf Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Fri, 17 Dec 2021 10:36:47 +0100 Subject: [PATCH] Rename is_route helper functiont to is_callback --- application/helpers/routes_helper.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/application/helpers/routes_helper.php b/application/helpers/routes_helper.php index 1711101a..17ce1c34 100644 --- a/application/helpers/routes_helper.php +++ b/application/helpers/routes_helper.php @@ -30,18 +30,21 @@ if ( ! function_exists('route_api_resource')) } } -if ( ! function_exists('is_route')) +if ( ! function_exists('is_callback')) { /** - * Check whether the current request matches the provided routed URI. + * Check whether the current request matches the provided controller/method callback. * - * @param string $uri Routed URI (as in controller/method). + * @param string $class Controller class name. + * @param string $method Controller method name. + * + * @return bool */ - function is_route(string $uri): bool + function is_callback(string $class, string $method): bool { /** @var EA_Controller $CI */ $CI =& get_instance(); - return $CI->uri->ruri_string() === $uri; + return $CI->router->class === $class && $CI->router->method === $method; } }