Created
October 2, 2010 03:01
-
-
Save josegonzalez/607211 to your computer and use it in GitHub Desktop.
Example usage of CakeForm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class UsersController extends AppController { | |
/** | |
* Automagic login via AuthComponent | |
* | |
* @return void | |
* @author Jose Diaz-Gonzalez | |
*/ | |
function login() { | |
} | |
/** | |
* Alternative login for administrators | |
* | |
* @return void | |
* @author Jose Diaz-Gonzalez | |
*/ | |
function authenticate() { | |
$login_form = new LoginForm(); | |
if (!empty($this->data)) { | |
$login_form->bindData($this->data); | |
if ($login_form->isValid()) { | |
$login_form->execute(); | |
} | |
} | |
$this->set(compact('login_form')); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment