Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example usage of CakeForm
<?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