How to send data to another .ctp view file from controller


Write something like the bellow code in your controller.

class TestController extends AppController {

public function test() {
  $this->autoRender = false;
  $this->set('data', $this->Model->find('all'));
  $this -> render(`/Controller/index`);
  }
}
Advertisements