diff options
Diffstat (limited to 'poc/poc02-compiling-cake/src/workdir/in/app/View/Posts/index.ctp')
-rw-r--r-- | poc/poc02-compiling-cake/src/workdir/in/app/View/Posts/index.ctp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/poc/poc02-compiling-cake/src/workdir/in/app/View/Posts/index.ctp b/poc/poc02-compiling-cake/src/workdir/in/app/View/Posts/index.ctp new file mode 100644 index 0000000..754b378 --- /dev/null +++ b/poc/poc02-compiling-cake/src/workdir/in/app/View/Posts/index.ctp @@ -0,0 +1,33 @@ +<h1>Blog posts</h1> +<p><?php echo $this->Html->link('Add Post', array('action' => 'add')); ?></p> +<table> + <tr> + <th>Id</th> + <th>Title</th> + <th>Actions</th> + <th>Created</th> + </tr> + +<!-- Here's where we loop through our $posts array, printing out post info --> + + <?php foreach ($posts as $post): ?> + <tr> + <td><?php echo $post['Post']['id']; ?></td> + <td> + <?php echo $this->Html->link($post['Post']['title'], array('action' => 'view', $post['Post']['id'])); ?> + </td> + <td> + <?php echo $this->Form->postLink( + 'Delete', + array('action' => 'delete', $post['Post']['id']), + array('confirm' => 'Are you sure?')); + ?> + <?php echo $this->Html->link('Edit', array('action' => 'edit', $post['Post']['id'])); ?> + </td> + <td> + <?php echo $post['Post']['created']; ?> + </td> + </tr> + <?php endforeach; ?> + +</table> |