Welcome Guest, Not a member yet? Register   Sign In
SOLVED: CI 4.0.2 and subdirectories
#6

(03-13-2020, 08:14 AM)InsiteFX Wrote: You need to namespace all folders and sub-folders.

If in the Controllers directory then:
PHP Code:
<?php
namespace App\Controllers

If the Controller is in a sub directory:
PHP Code:
<?php
namespace App\Controllers\sub-directory

When extending or usingĀ a Controller from a sub directory:
PHP Code:
use App\Controllers\sub-directory 

Excellent! Thank you, it's working now.

a few things before:
- Yes, you need to add the folder name into the namespace
- the folder must start with an upper-case letter
- The folder has the same rules as any Controller file (I think)


PHP Code:
<?php namespace App\Controllers\Dot2;

use 
CodeIgniter\Controller;

class 
Test extends Controller 
    

Reply


Messages In This Thread
SOLVED: CI 4.0.2 and subdirectories - by mariofix - 03-12-2020, 02:35 PM
RE: CI 4.0.2 and subdirectories - by Bennito254 - 03-13-2020, 05:39 AM
RE: CI 4.0.2 and subdirectories - by InsiteFX - 03-13-2020, 08:14 AM
RE: CI 4.0.2 and subdirectories - by juancarlosv - 04-03-2020, 10:23 AM
RE: CI 4.0.2 and subdirectories - by mariofix - 04-12-2020, 02:12 PM
RE: CI 4.0.2 and subdirectories - by anmar_dev - 04-03-2020, 05:16 PM



Theme © iAndrew 2016 - Forum software by © MyBB