>  <h1>Blog posts</h1>
>  <p><?php echo $html->link("Add Post", "/posts/add"); ?>
>  <table>
>         <tr>
>                 <th>Id</th>
>                 <th>Title</th>
>                 <th>Action</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 
> $html->link($post['Post']['title'],'/posts/view/'.$post
>  ['Post']['id']);?>
>                 </td>
>                 <td>
>                         <?php echo $html->link(
>                                 'Delete',
>                                 "/posts/delete/{$post['Post']['id']}",
>                                 null,
>                                 'Are you sure?'
>                         )?>
>                         <?php echo $html->link('Edit', 
> '/posts/edit/'.$post['Post']['id']);?
>  >
>                 </td>
>                 <td><?php echo $post['Post']['created']; ?></td>
>         </tr>
>  <?php endforeach; ?>
>
>  </table>
>
>  -------------
>  <!-- File: /app/views/posts/add.ctp -->
>
>  <h1>Add Post</h1>
>  <?php
>  echo $form->create('Post');
>  echo $form->input('title');
>  echo $form->input('body', array('rows' => '3'));
>  echo $form->end('Save Post');
>  ?>
>  ---------------
>  <h1>Edit Post</h1>
>  <?php
>         echo $form->create('Post', array('action' => 'edit'));
>         echo $form->input('title');
>         echo $form->input('body', array('rows' => '3'));
>         echo $form->input('id', array('type'=>'hidden'));
>         echo $form->end('Save Post');
>  ?>

All your views look ok

>  my urls: http://localhost/index.php/posts/index
>  http://localhost/index.php/posts/view/1
>  http://localhost/index.php/posts/edit/1
>  http://localhost/index.php/posts/add

A couple of Qs:

- what are you testing/deploying on?
- is your cake app (app/core/vendors etc) in the route of your test
server, or should the urls in fact be:

http://localhost/cakedir/posts/index
http://localhost/cakedir/posts/view/1
http://localhost/cakedir/posts/edit/1
http://localhost/cakedir/posts/add

Cheers,

Jon


-- 

jon bennett
w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to