Welcome Guest, Not a member yet? Register   Sign In
Auto Routing and redirect() not working
#1

(This post was last modified: 01-30-2023, 12:45 AM by objecttothis.)

Converting an application from CI3.x to CI 4.1.3

My Controllers are in app/Controllers/

PHP Code:
<?php

namespace App\Controllers;

use 
App\Libraries\MY_Migration;
use 
App\Models\Employee;
use 
Config\Migrations;
use 
Config\Services;

/**
 * @property employee employee
 */
class Login extends BaseController


My app/Config/Routes.php includes
PHP Code:
<?php

namespace Config;

// Create a new instance of our RouteCollection class.
$routes Services::routes();

// Load the system's routing file first, so that the app and ENVIRONMENT
// can override as needed.
if (file_exists(SYSTEMPATH 'Config/Routes.php'))
{
 require 
SYSTEMPATH 'Config/Routes.php';
}

/*
 * --------------------------------------------------------------------
 * Router Setup
 * --------------------------------------------------------------------
 */
$routes->setDefaultNamespace('App\Controllers');
$routes->setDefaultController('Login');
$routes->setDefaultMethod('index');
$routes->setTranslateURIDashes(false);
$routes->set404Override();
$routes->setAutoRoute(true); 

but php spark routes includes no "auto" entries and I end up with an error when I navigate to https://[domain]/pos_dev/public


CodeIgniter\HTTP\Exceptions\HTTPException

route cannot be found while reverse-routing.
Reply


Messages In This Thread
Auto Routing and redirect() not working - by objecttothis - 12-06-2022, 08:22 AM
RE: Auto Routing (Legacy) not working - by kenjis - 12-10-2022, 05:58 PM
Redirect() not working - by objecttothis - 01-30-2023, 12:44 AM



Theme © iAndrew 2016 - Forum software by © MyBB