Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jun 29th, 2012  |  syntax: PHP  |  size: 0.67 KB  |  views: 41  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. }
clone this paste RAW Paste Data