Reputation: 453
First thing to learn about codeigniter should be how to create a simple view which is the appearance of your web application?. I had tried so many tutorials on Internet for making a MVC and always succeeded but when i try to make my own home page of site my myself i always failed.
The only thing that showed up is:
"404 Page Not Found
The page you requested was not found. "
I just want a simple thing. When anyone open www.mywebsite.com my home page must be open.
Is this necessary to make a model if there is no database work in needed?
Now i tell you what i did myself to make my home page.
1. First of all i made a file 'index.php'
in view folder (Simple HTML file).
2. I added a file 'index_controller.php'
in controller folder. (see code below)
class Index_controller extends CI_Controller{
public function __construct()
{
parent::__construct();
}
public function index()
{
$this->load->view('index');
}
}
What more should i do to make my code working?
Upvotes: 1
Views: 762
Reputation: 3008
Is this necessary to make a model if there is no database work in needed?
You probably are missing one thing, the default controller. If you try now,
it'll work right ?
But
won't because you have to tell codeigniter that it must load by default Index_controller.
You can define that in application/config/routes.php :
$route['default_controller'] = 'Index_controller';
Upvotes: 2