When I load view from App/Views it's worked but when it's from modules folder it's failed
My autoload
public $psr4 = [ APP_NAMESPACE => APPPATH, // For custom app namespace 'Config' => APPPATH . 'Config', 'Modules' => ROOTPATH . 'modules', ];
My Controller
<?php namespace Modules\Assets\Controllers; use App\Controllers\BaseController; class AssetsControl extends BaseController { public function index() { return view('Modules/Assets/Views/index'); // failed return view('Views/welcome_message'); // Success } } ?>
Folder Structures
1. app 2. modules - Assets + Config + Controllers + Models + Views 3. public 4. test
https://stackoverflow.com/questions/65404456/cannot-load-view-from-hmvc-modules-codeigniter4 December 22, 2020 at 03:01PM
没有评论:
发表评论