我正在将我的应用程序从codeigniter移动到cakephp。我有我的第一个问题,我不能够解决它......CakePhp问题:找不到类'登录'
在我的控制器FeedController,我打电话这样的:Login::isLoggedInUser()
我在模型文件夹中,该文件的login.php,此代码:
<?php
App::uses('Login', 'AppModel');
class Login extends AppModel {
public function __construct() {
session_start();
parent::__construct();
}
public static function authenticateUser() {
$_SESSION['username'] = 'feeds.123';
return $_SESSION['username'];
}
public static function isLoggedInUser() {
if (isset($_SESSION['username']) && $_SESSION['username'] == 'feeds.123') {
return true;
}
return false;
}
}
我看不出有什么不对,我的错误是:
Error: Class 'Login' not found
File: D:\wamp\www\app\Controller\FeedController.php
Line: 12
感谢您的帮助。
阅读该文档会作出这个问题,所以没有必要:http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html – mark