How to create view function?

0

I'm creating a function in controller UsersController , this function is for users who forget the password. When I try to open view , it returns an error that the function does not exist.

The structure looks like this:

  • view esqueci_senha.ctp
  • function function esqueciSenha()

To open the view I do this:

<a href="<?php echo $this->Html->url("/Users/esqueci_senha")?>"><i class="glyphicon glyphicon-question-sign"></i> Esqueci minha senha</a>'

The error:

  

Error: The action forgot_password is not defined in controller   UsersController

     

Error: Create UsersController :: forgot_password () in file:   app \ Controller \ UsersController.php.

     

class UsersController extends AppController {

     

public function forgot_password () {

     

}

     

}

How to solve?

    
asked by anonymous 23.12.2015 / 04:55

2 answers

1

The error says that it is waiting for action , in its controller , call esqueci_senha , not esqueciSenha . I think you just need to fix this on the controller:

function esqueci_senha() {
    // código da action
}
    
23.12.2015 / 05:02
0

On Controller:

Class UsersController extends AppController {

    public function esqueciSenha() {

    }

}

File name: forgot_password.php

    
05.02.2016 / 12:42