Reputation: 15
I am trying to display table Users, and I want it to display the user with the role "Moderator" only.
public function moderators() {
$this->set('users', $this->paginate());
$this->User->find('all', array(
'conditions' => array('User.role' => 'moderator')
));
This is my controller, and it seems that it is still displaying all data in my table.
Upvotes: 0
Views: 49
Reputation: 6650
Try to use custom query for that:
$this->User->query("select * from users where role = 'moderator';");
Upvotes: 1