I am having problems loading the page on the controller, which I also want.
For example, I want my site to load as localhost / sitename / catergory1 / catergory2, where catergory 1 is its own controller and 2 is its method. So I tried adding this to my .php routes:
$route['catergory1'] = 'catergory1/cat1';
with my controller file configured as:
-Controller
-Home.php
-catergory1<is a subfolder
-cat1.php
that I thought would make codeigniter load the cat1 controller inside the catergory 1 folder, but instead, when I go to localhost / sitename / catergory1, it just loads my default controller " home ". I tried using it both in uri routes and in reserved routes as part of route.php, but it still won't work. This is probably something really easy, but new to it.
The controllers themselves simply regard their attitude towards them:
Home controller:
class Home extends CI_Controller {
function index() {
$this->load->view('home');
}
}
Cat1 Controller:
class Cat1 extends CI_Controller{
function index() {
$this->load->view('cat1');
}
}
Am I just stupid and miss something simple?
Thank.
source
share