• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sub Directory on Controller

#17
(09-24-2019, 08:34 AM)MGatner Wrote: @andybiancoblu Are you getting an error message? E.g. 404 Not Found.

I don't *think* it would matter but you should try uppercase on your namespace: `App\Controllers\Dashboard`

Also make sure auto-routing is enabled (should be if you didn't change anything) in **app/Config/Routes.php**
Hello again.
I'm desperate! I really want to start developing a project with CI4 because I find it really robust as a framework, but this issue with subfolders is blocking me.

Consider my Routes.php:
Code:
<?php namespace Config;

$routes = Services::routes(true);
if (file_exists(SYSTEMPATH . 'Config/Routes.php'))
{
    require SYSTEMPATH . 'Config/Routes.php';
}

$routes->setDefaultNamespace('App\Controllers');
$routes->setDefaultController('Dashboard');
$routes->setDefaultMethod('index');
$routes->setTranslateURIDashes(false);
$routes->set404Override();
$routes->setAutoRoute(true);

$routes->get('/', 'App\Controllers\dashboard\Dashboard::index');

if (file_exists(APPPATH . 'Config/' . ENVIRONMENT . '/Routes.php'))
{
    require APPPATH . 'Config/' . ENVIRONMENT . '/Routes.php';
}
I omitted deafault comments...

What's wrong with my configuration?
I tried recreating virtualhost config to check if there was something wrong there, but nothing worked.

Can anyone help?
[Image: https://vulndetect.org/assets/uploads/fi...docker.ico]

Andy Biancoblu 

Quote:Once you have eliminated the impossible, whatever remains, however improbable, must be the truth.
Reply


Messages In This Thread
Sub Directory on Controller - by finhawkman - 04-05-2019, 09:06 PM
RE: Sub Directory on Controller - by finhawkman - 04-06-2019, 12:15 AM
RE: Sub Directory on Controller - by pkMyt1 - 04-10-2019, 09:26 AM
RE: Sub Directory on Controller - by michael.j - 05-02-2019, 01:44 AM
RE: Sub Directory on Controller - by finhawkman - 05-02-2019, 06:49 AM
RE: Sub Directory on Controller - by michael.j - 05-03-2019, 01:14 AM
RE: Sub Directory on Controller - by InsiteFX - 05-03-2019, 03:20 AM
RE: Sub Directory on Controller - by finhawkman - 05-03-2019, 11:47 PM
RE: Sub Directory on Controller - by InsiteFX - 05-04-2019, 04:37 AM
RE: Sub Directory on Controller - by MGatner - 09-24-2019, 08:34 AM
RE: Sub Directory on Controller - by andybiancoblu - 09-26-2019, 02:18 AM
RE: Sub Directory on Controller - by InsiteFX - 09-25-2019, 02:47 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme ¬© 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.