I am simply doing login and registration of users in cake php, here is my
file structure!
app/controller/users_controller.php
<?php
class UsersController extends AppController {
public function beforeFilter() {
parent::beforeFilter();
$this->Auth->allow('add');
}
public function add() {
if(!empty($this->data)) {
$this->User->create();
if($this->User->save($this->data)) {
$this->Session->SetFlash('User Created!');
$this->redirect(array('action'=>'login'));
}
else {
$this->Session->SetFlash('Please correct the errors!');
}
}
}
public function login() {
}
public function logout() {
$this->redirect($this->Auth->logout());
}
}?>
app/app_controller.php
<?php
class AppController extends Controller {
public $components = array(
'Auth' => array(
'authorize'=>'controller'
),
'Session'
);
public function isAuthorized() {
return true;
}
}?>
app/View/users/login.ctp
<?php
echo $this->Form->create(array('action'=>'login'));
echo $this->Form->inputs(array('legend'=>'Login','username','password'));
echo $this->Form->end('Login');?>
app/View/users/add.ctp
<?php
echo $this->Form->create();
echo $this->Form->inputs(array(
'legends' => 'Signup',
'username',
'password'));
echo $this->Form->end('Submit');?>
and i am browsing below URL
www.abc.com/../cakephp/users/add
i get below erros
Error: UsersController could not be found.
Error: Create the class UsersController below in file:
app/Controller/UsersController.php
<?phpclass UsersController extends AppController {
}
Notice: If you want to customize this error message, create
app/View/Errors/missing_controller.ctp
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.