I need help, I don’t why this is not working…
I created function in my pageController
public function listusers(){
$this->loadModel(‘Users’);
$query = $this->Users->find(‘all’);
$results = $query->toArray();
$this->set(‘users’,$results);
}
And a view in template/pages/listusers.ctp
in there I wrote
but, I recieve this error:
[ Notice (8)](javascript:void(0);): Undefined variable: users [ APP/Template/Pages/listusers.ctp , line 1 ]
/src/Template/Pages/listusers.ctp (line 1 )
null
(table users has some users in there )
I use cakePhp in 3.5 version