エラーが発生しました要求されたファイルを読み込めません:login_view.php。私はログインコントローラを持っています要求されたファイルを読み込めません:login_view.php
<?php if (! defined('BASEPATH')) exit('No direct script access allowed');
class Login extends CI_Controller {
function __construct()
{
parent::__construct();
}
function index()
{
$this->load->helper(array('form'));
$this->load->view('login_view');
}
}
?>
とロードされているビュー。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Simple Login with CodeIgniter</title>
</head>
<body>
<?php echo validation_errors(); ?>
<?php echo form_open('verifylogin'); ?>
<label for="username">Username:</label>
<input type="text" size="20" id="username" name="username"/>
<br/>
<label for="password">Password:</label>
<input type="password" size="20" id="password" name="password"/>
<br/>
<input type="submit" value="Login"/>
</form>
</body>
</html>
VerifyLoginページ
class VerifyLogin extends CI_Controller
{
function __construct()
{
parent::__construct();
$this->load->model('user','',TRUE);
}
function index()
{
$this->load->library('form_validation');
if($this->form_validation->run() == FALSE)
{
$this->load->view('login_view');
} else
{
redirect('home', 'refresh');
}
}
}
私を導いてください。ありがとう。
ここにverifyloginのコードもあります。 –
<?php class VerifyLoginはCI_Controllerを継承します。{ function __construct() { parent :: __ construct(); $ this-> load-> model( 'user'、 ''、TRUE); } function index() { $ this-> load-> library( 'form_validation'); if($ this-> form_validation-> run()== FALSE) { $ this-> load-> view( 'login_view'); } else { redirect( 'home'、 'refresh'); } } –
ちょうど注:クラスとファイル名の最初の文字のみ大文字にする必要があります。ここで説明します。 http://www.codeigniter.com/user_guide/general/controllers.html#let-s-try-it-hello-world – user4419336