I'm new in cakePhp, I've been following a tutorial and (in the tutorial) I created an user table called users, in my database(follow the naming conventions) and everything worked well, but in my project I created a table with a different name called usuarios then, I created the model, view and controller files, I created a file called "login.ctp" with the respective form,and in AppController.php I put this code :
class AppController extends Controller {
public $helpers = array('Html','Form','Session');
public $components = array('Session','Auth'=>array(
'controller'=>'usuarios',
'action'=>'login'
)
);
public function beforeFilter(){
$this->Auth->Allow('index');
}
}
And inside the usuariosController.php I added this code:
public function logout(){
$this->Auth->logout();
$this->redirect('Pensums/index');
}
public function login(){
if($this->request->is('post')){
if($this->Auth->login()){
return $this->redirect($this->Auth->redirecturl());
}
$this->Session->setFlash(_('Invalid username or password, please try again'));
}
}
but I receive this error from server:
Missing Controller
Error: UsersController could not be found.
Error: Create the class UsersController below in file: app\Controller\UsersController.php
is something missing? please help.