Welcome Guest, Not a member yet? Register   Sign In
Using Viewi and CI4
#3

(08-22-2022, 07:29 AM)SubrataJ Wrote:
PHP Code:
app/Config/Routes.php
//.. Other routes

// Add this to Footer

// Including all module routes

$modules_path ROOTPATH 'Modules/';
$modules      scandir($modules_path);

foreach (
$modules as $module)
{
    if ($module === '.' || $module === '..')
    {
        continue;
    }

    if (is_dir($modules_path) . '/' $module)
    {
        $routes_path $modules_path $module '/Config/Routes.php';
  
        
if (file_exists($routes_path))
        {
            require $routes_path;
        }
        else
        {
            continue;
        }
    }



copied from @InsiteFX answer, this was working for me so suggesting ya too.
This is for loading routes from different modules it doesn't solve my issue.
Reply


Messages In This Thread
Using Viewi and CI4 - by vimkaf - 08-22-2022, 07:03 AM
RE: Using Viewi and CI4 - by SubrataJ - 08-22-2022, 07:29 AM
RE: Using Viewi and CI4 - by vimkaf - 08-22-2022, 08:52 AM
RE: Using Viewi and CI4 - by kenjis - 08-23-2022, 07:22 PM
RE: Using Viewi and CI4 - by kenjis - 10-14-2022, 01:53 AM
RE: Using Viewi and CI4 - by kenjis - 10-17-2022, 03:14 AM
RE: Using Viewi and CI4 - by murugappan - 08-27-2023, 11:20 PM
RE: Using Viewi and CI4 - by kenjis - 10-25-2022, 05:08 AM
RE: Using Viewi and CI4 - by murugappan - 08-26-2023, 09:18 PM
RE: Using Viewi and CI4 - by datamweb - 08-27-2023, 12:33 AM
RE: Using Viewi and CI4 - by murugappan - 08-27-2023, 09:14 PM
RE: Using Viewi and CI4 - by kenjis - 08-27-2023, 11:27 PM
RE: Using Viewi and CI4 - by murugappan - 08-28-2023, 02:52 AM
RE: Using Viewi and CI4 - by ivan_viewi - 12-02-2023, 05:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB