Skip to content

Your codes can be upgrade to 4.5.4  #18

Description

@bruosama

My PHP version 8.3.10

These are the steps i done

composer create-project mufidjamaluddin/codeigniter4-hmvc ci4-hmvc

cd ci4-hmvc
copy folder Config from ci4 latest 4.5.4 overwrite

copy index and spark

cp vendor/codeigniter4/framework/public/index.php public/index.php
cp vendor/codeigniter4/framework/spark spark

copy env to .env
edit .env uncomment
app.baseURL = 'http://ci4-hmvc.test/'

Config/Routes.php tambah ini

/**


  • HMVC Routing

*/

foreach(glob(APPPATH . 'Modules/*', GLOB_ONLYDIR) as $item_dir)
{
if (file_exists($item_dir . '/Config/Routes.php'))
{
require_once($item_dir . '/Config/Routes.php');
}
}

Config/Routing.php comment dan tukar

/**
* For Defined Routes and Auto Routing.
* The default namespace to use for Controllers when no other
* namespace has been specified.
*
* Default: 'App\Controllers'
*/
//public string $defaultNamespace = 'App\Controllers';
public string $defaultNamespace = 'App\Modules\Land\Controllers';

//nota - working
php spark list
php spark app:info
php spark env

Create Module - working

php spark module:create User

Browse to...
http://ci4-hmvc.test/user

ERROR!

syntax error, unexpected token \

Fatal error: Uncaught Error: Call to undefined method CodeIgniter\Debug\ExceptionHandler::cleanPath() in E:\laragon-6.0.0\www\ci4-hmvc\app\Views\errors\html\error_exception.php:33 Stack trace: #0 E:\laragon-6.0.0\www\ci4-hmvc\vendor\codeigniter4\framework\system\Debug\BaseExceptionHandler.php(266): include() #1 E:\laragon-6.0.0\www\ci4-hmvc\vendor\codeigniter4\framework\system\Debug\BaseExceptionHandler.php(269): CodeIgniter\Debug\BaseExceptionHandler->CodeIgniter\Debug{closure}() #2 E:\laragon-6.0.0\www\ci4-hmvc\vendor\codeigniter4\framework\system\Debug\ExceptionHandler.php(114): CodeIgniter\Debug\BaseExceptionHandler->render(Object(ParseError), 500, 'E:\laragon-6.0....') #3 E:\laragon-6.0.0\www\ci4-hmvc\vendor\codeigniter4\framework\system\Debug\Exceptions.php(163): CodeIgniter\Debug\ExceptionHandler->handle(Object(ParseError), Object(CodeIgniter\HTTP\IncomingRequest), Object(CodeIgniter\HTTP\Response), 500, 1) #4 [internal function]: CodeIgniter\Debug\Exceptions->exceptionHandler(Object(ParseError)) #5 {main} thrown in E:\laragon-6.0.0\www\ci4-hmvc\app\Views\errors\html\error_exception.php on line 33

Please help me to fix this. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions