Back to PhocacartUtils class

Method isController

public static
isController
(mixed $controllerToCheck = '')

Method isController - Source code

public static function isController($controllerToCheck = '')
{
    if ($controllerToCheck != '') {
        $app = Factory::getApplication();
        //$task 		= $app->input->get('task','', 'raw');
        $controller = $app->input->get('controller', '');
        // Set in POS controllers
        $option = $app->input->get('option', '');
        //$taskA		= explode('.', $task);
        //if ($option == 'com_phocacart' && isset($taskA[0]) && $taskA[0] == $controllerToCheck) {
        if ($option == 'com_phocacart' && $controller == $controllerToCheck) {
            return true;
        }
    }
    return false;
}