Welcome Guest, Not a member yet? Register   Sign In
Views Within Modules
#2

(This post was last modified: 03-18-2021, 06:06 PM by iRedds.)

1. It is not clear why you changed the startup. This is not critical, but some kind of garbage.
PHP Code:
require_once SYSTEMPATH 'Config/AutoloadConfig.php'

2.
PHP Code:
'Modules'       => APPPATH 'Modules\Admin' 

The Modules namespace should be found in the APPPATH . 'Modules\Admin' directory.
Although you register a namespace, you don't use it.
Instead, you use the application namespace App\Modules\Admin\Controllers
And this only works for you because the directory with the module is in the app directory.

The view takes either a path to a relative default template directory (changed in the Path config) or a namespace.

PHP Code:
view('aaa/bbb'// <-- app/Views/aaa/bbb.php
view('Namespace\To\view'// <-- NamespaceLocation/Namespace/To/view.php

// and 
return $this->template('Admin/Views/dashboard'$data); // <-- app/Views/Admin/Views/dashboard.php 
Reply


Messages In This Thread
Views Within Modules - by rmartin93 - 03-18-2021, 12:31 PM
RE: Views Within Modules - by iRedds - 03-18-2021, 06:04 PM
RE: Views Within Modules - by rmartin93 - 03-19-2021, 07:10 AM
RE: Views Within Modules - by rmartin93 - 03-19-2021, 07:56 AM



Theme © iAndrew 2016 - Forum software by © MyBB