CakePHP accessing other controllers
- by James
CakePHP Newbie :)
I am having trouble accessing another controller and passing that data to a view in one of my controllers:
In controllers/landings_controller.php:
var $uses = 'User';
function home() {
$userdata = $this->User->read();
$this->set(compact('userdata'));
}
In views/landings/home.ctp:
<?php
echo $this->userdata;
?>
When accessing /landings/home I get the following error:
Notice (8): Undefined property: View::$userdata [APP/views/landings/home.ctp, line 38]
I don't know what I am doing wrong. Any help?
Thanks!