Tôi đang sử dụng Laravel v4.2 và nhận được lỗi sau:Laravel 4: Phân loại không tồn tại
Class UserController does not exist
Đây là mã của tôi:
user.php
class UserController extends BaseController {
public function index(){
return View::make('/')->with('title', 'Home | Public Review');
}
}
routes.php
Route::get('/', array(
'as' => 'index',
'uses' => '[email protected]'
));
Làm cách nào để giải quyết lỗi này?
'php artisan dump-autoload'? Bộ điều khiển của bạn có nằm trong 'app/controllers /' không? Điều gì sẽ xảy ra nếu bạn đặt tên cho tệp 'app/controllers/UserController.php' (thay vì' user.php')? – bishop
Cảm ơn @bishop. Tôi đã thay đổi user.php thành UserController.php và nó đang hoạt động ngay bây giờ. :) – PandaUser
Có! Cảm ơn một lần nữa @ giám mục. – PandaUser