Advertisement
Guest User

Untitled

a guest
Oct 25th, 2014
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. <?php
  2.  
  3. class Task extends AppModel
  4. {
  5. var $name = 'Task';
  6. }
  7.  
  8. ?>
  9.  
  10. <?php
  11.  
  12. class TasksController extends AppController
  13. {
  14. var $name = 'Tasks';
  15.  
  16. function index()
  17. {
  18. $this->set('tasks', $this->Task->find('all'));
  19. }
  20. }
  21.  
  22. ?>
  23.  
  24. <h2>Tasks</h2>
  25. <?php if (empty($tasks)): ?>
  26. There are no tasks in this list
  27. <?php else : ?>
  28. <table>
  29. <tr>
  30. <th>Title</th>
  31. <th>Status</th>
  32. <th>Created</th>
  33. <th>Modified</th>
  34. <th>Actions</th>
  35. </tr>
  36. <?php foreach ($tasks as $task): ?>
  37. <tr>
  38. <td>
  39. <?php echo $task['Task']['title'] ?>
  40. </td>
  41. <td>
  42. <?php
  43. if ($task['Task']['done']) echo "Done";
  44. else echo "Pending";
  45. ?>
  46. </td>
  47. <td>
  48. <?php echo $task['Task']['created'] ?>
  49. </td>
  50. <td>
  51. <?php if ($task['Task']['modified']) ?>
  52. </td>
  53. <td>
  54. <!-- actions on tasks will be added later -->
  55. </td>
  56. </tr>
  57. <?php endforeach; ?>
  58. </table>
  59. <?php endif; ?>
  60.  
  61. Missing View
  62. Error: The view for TasksController::index() was not found.
  63.  
  64. Error: Confirm you have created the file: C:xampphtdocsvycakephp-2.5.5appViewTasksindex.ctp
  65.  
  66. Notice: If you want to customize this error message, create appViewErrorsmissing_view.ctp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement