[eluser]ded0t[/eluser]
hi all,
i try to make a login form using CI 2.0 and i got this error message : Unable to load the requested file: main_content.php
even, there's a similar question in this thread "http://ellislab.com/forums/viewthread/155359/#751532", i still not understand how to solve that's error.
Controller side :
login.php
Code:
<?php
class Login extends CI_Controller
{
function index()
{
$data['main_content'] = 'login_form';
$this->load->view('includes/template', $data);
}
}
?>
View side :
login_form.php
Code:
<div id="login_form">
<h1>Login Form</h1>
<?php
echo form_open('login/validate_credentials');
echo form_input('username', 'Username');
echo form_password('password', 'Password');
echo form_submit('submit', 'Login');
echo anchor('login/signup', 'Create Account');
?>
</div>
template.php
Code:
<?php $this->load->view('includes/header'); ?>
<?php $this->load->view('main_content'); ?>
<?php $this->load->view('includes/footer'); ?>
header.php
Code:
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset-utf-8">
<title>
login
</title>
</head>
<body>
footer.php
Code:
</body>
</html>
Configuration :
routes.php
Code:
$route['default_controller'] = "login";
config.php
Code:
$config['base_url'] = 'http://localhost/Code2.0/';
autoload.php
Code:
$autoload['helper'] = array('url','form');
do i missing something? thanks in advance