Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Task extends AppModel
- {
- var $name = 'Task';
- }
- ?>
- <?php
- class TasksController extends AppController
- {
- var $name = 'Tasks';
- function index()
- {
- $this->set('tasks', $this->Task->find('all'));
- }
- }
- ?>
- <h2>Tasks</h2>
- <?php if (empty($tasks)): ?>
- There are no tasks in this list
- <?php else : ?>
- <table>
- <tr>
- <th>Title</th>
- <th>Status</th>
- <th>Created</th>
- <th>Modified</th>
- <th>Actions</th>
- </tr>
- <?php foreach ($tasks as $task): ?>
- <tr>
- <td>
- <?php echo $task['Task']['title'] ?>
- </td>
- <td>
- <?php
- if ($task['Task']['done']) echo "Done";
- else echo "Pending";
- ?>
- </td>
- <td>
- <?php echo $task['Task']['created'] ?>
- </td>
- <td>
- <?php if ($task['Task']['modified']) ?>
- </td>
- <td>
- <!-- actions on tasks will be added later -->
- </td>
- </tr>
- <?php endforeach; ?>
- </table>
- <?php endif; ?>
- Missing View
- Error: The view for TasksController::index() was not found.
- Error: Confirm you have created the file: C:xampphtdocsvycakephp-2.5.5appViewTasksindex.ctp
- Notice: If you want to customize this error message, create appViewErrorsmissing_view.ctp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement