1. <?php
  2. App::uses('AppController', 'Controller');
  3. /**
  4.  * Notes Controller
  5.  *
  6.  */
  7. class NotesController extends AppController
  8. {
  9.  
  10.     /**
  11.      * Scaffold
  12.      *
  13.      * @var mixed
  14.      */
  15.     //public $scaffold;
  16.     public $components = array('RequestHandler');
  17.  
  18.  
  19.     public function index() {
  20.         $recipes = $this->Note->find('all');
  21.         $this->set(array(
  22.             'note' => $recipes,
  23.             '_serialize' => array('note')
  24.         ));
  25.     }
  26.  
  27.     public function view($id) {
  28.         $note = $this->Note->findById($id);
  29.         $this->set(array(
  30.             'recipe' => $note,
  31.             '_serialize' => array('note')
  32.         ));
  33.     }
  34.  
  35.  
  36.  
  37. }