views:

34

answers:

2

This is my basic file structure

/system
- /application
- /config
- - -routes.php
- /controllers
- - -about.php
- - -home.php
- - /admin
- - - -dashboard.php
- - - -login.php
- - - -news.php

And in routes:

$route['admin']        = 'admin/dashboard'; //This should be the default.
$route['admin/(:any)'] = 'admin/$1';

Browsing to http://mywebsite.com/admin results in this error;

An Error Was Encountered

Unable to load the requested file: dashboard.php

I've read the documentation on controllers and sub-folders are supported. What am I doing wrong here?

A: 

The file dashboard.php was a view, not a controller.

I had a line $this->view->load('no/folder/here/dashboard.php'); which was throwing the error.

It's probably a good idea to name all the view files view_dashboard.php to help identify which file does what.

Keyo
+1  A: 

Only because the someone has fubar'd the proper folder structure, there should be a 'views' folder which would avoid any confusion :/

philm
It is in the views folder. It just isn't too helpful when the error doesn't tell me which folder or which line the error has occurred on.Maybe I should have a debug log running :)
Keyo
Ahh sorry matey, I thought the basic structure you posted was complete ;)
philm