I am using codeigniter 2.1.2, WAMP, im just learning it and encountered a problem. all i did was following -> created a view "home.php" with some text in it. -> created a controller "homecontroller.php" as follows:
<?php
class homecontroller extends CI_Controller{
function iloadhomepage(){
$this->load->view('home');
}
}
up till here it works fine when i run
"http://localhost/CodeIgniterTut/index.php/homecontroller/iloadhomepage"
next I changed the default controller in "routes.php" (in config) to
$route['default_controller'] = "homecontroller";
so that when i run "http://localhost/CodeIgniterTut/index.php" i would get my "home.php" but rather im getting a 404 error, am i doing a mistake anywhere? please help
put this in homecontroller.php
class Homecontroller extends CI_Controller{
public function index(){
$this->load->view('home');
}
then type localhost/CodeIgniterTut/index.php,and also make every class name begin with a capital letter (thats a standard of coding).
"The "index" function is always loaded by default if the second segment of the URI is empty,The second segment of the URI determines which function in the controller gets called". according to ci manual.