2020年12月22日星期二

Cannot load view from HMVC/Modules Codeigniter4

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  

Error message from CI4 Error message CI4

https://stackoverflow.com/questions/65404456/cannot-load-view-from-hmvc-modules-codeigniter4 December 22, 2020 at 03:01PM

没有评论:

发表评论