1 | <?php |
||
6 | class NoteController extends Controller |
||
7 | { |
||
8 | /** |
||
9 | * Construct this object by extending the basic Controller class |
||
10 | */ |
||
11 | public function __construct() |
||
20 | |||
21 | /** |
||
22 | * This method controls what happens when you move to /note/index in your app. |
||
23 | * Gets all notes (of the user). |
||
24 | */ |
||
25 | public function index() |
||
31 | |||
32 | /** |
||
33 | * This method controls what happens when you move to /dashboard/create in your app. |
||
34 | * Creates a new note. This is usually the target of form submit actions. |
||
35 | * POST request. |
||
36 | */ |
||
37 | public function create() |
||
42 | |||
43 | /** |
||
44 | * This method controls what happens when you move to /note/edit(/XX) in your app. |
||
45 | * Shows the current content of the note and an editing form. |
||
46 | * @param $note_id int id of the note |
||
47 | */ |
||
48 | public function edit($note_id) |
||
54 | |||
55 | /** |
||
56 | * This method controls what happens when you move to /note/editSave in your app. |
||
57 | * Edits a note (performs the editing after form submit). |
||
58 | * POST request. |
||
59 | */ |
||
60 | public function editSave() |
||
65 | |||
66 | /** |
||
67 | * This method controls what happens when you move to /note/delete(/XX) in your app. |
||
68 | * Deletes a note. In a real application a deletion via GET/URL is not recommended, but for demo purposes it's |
||
69 | * totally okay. |
||
70 | * @param int $note_id id of the note |
||
71 | */ |
||
72 | public function delete($note_id) |
||
77 | } |
||
78 |