show Characters and Roles of an user

This commit is contained in:
coderkun 2014-02-09 13:33:38 +01:00
commit a0f85a976a
6 changed files with 116 additions and 0 deletions

View file

@ -31,6 +31,12 @@
'edit' => array('admin', 'moderator'),
'delete' => array('admin')
);
/**
* Required models
*
* @var array
*/
public $models = array('users', 'characters');
@ -62,9 +68,13 @@
// Get user
$user = $this->Users->getUserByUrl($userUrl);
// Get Characters
$characters = $this->Characters->getCharactersForUser($user['id']);
// Pass data to view
$this->set('user', $user);
$this->set('characters', $characters);
}