Welcome Guest, Not a member yet? Register   Sign In
How to run another controller folder in hmvc codeigniter 4
#3

(03-21-2022, 10:34 PM)iRedds Wrote: 1. Such a namespace entry is meaningless.
PHP Code:
        'Modules\Site\Home' => ROOTPATH'Modules/Site/Home'// here we have added.
        'Modules\Site\Student' => ROOTPATH'Modules/Site/Student'

Use
PHP Code:
        'Modules' => ROOTPATH'Modules'

2. This only works for one reason.
The namespace in the StudentController class is specified as
Modules\Site\Home\Controllers instead of Modules\Site\Student\Controllers

PHP Code:
<?php
namespace Modules\Site\Student\Controllers;

class 
StudentController 

3 The default namespace is Modules\Site\Home\Controllers.
Therefore, for the StudentController controller, you need to specify the appropriate namespace.

PHP Code:
$routes->get('([a-z0-9-]+)\.html$''\Modules\Site\Student\Controllers\StudentController::proByCate/$1');


 
perfectthank you very much 
Reply


Messages In This Thread
RE: How to run another controller folder in hmvc codeigniter 4 - by startup - 03-21-2022, 10:43 PM



Theme © iAndrew 2016 - Forum software by © MyBB