Putting code in app/pages/... is not going to get you your notes as the NotesController (or some other controller you write) will need to be called. As is, the PagesController is being called and it does not get your notes.
Following the tutorial you mentioned, you would want a page in /app/ views/notes/default.thtml and a method in NotesController called default() to get the notes. Or if you want to use the scaffold generated index, change your application app/config/routes.php to point "/" to "/notes/index". All of this is explained in the manual http://manual.cakephp.org - you really need to read it through several times to catch everything. HTH, David Lloyd -- lloydhome consulting http://lloydhome.com On Feb 9, 7:02 am, "Mr.Blue" <[EMAIL PROTECTED]> wrote: > HI there, > > Would you like to show me how could I use $scaffold on front page of > Cake PHP. I place this code on /app/pages/default.html in order to > list the notes on the front page. Such as:http://localhostinstead > ofhttp://localhost/notesas usual > (I follow this tutorial:http://www.sitepoint.com/article/application- > development-cakephp) > > <h1>My Notes</h1> > <table> > <tr> > <th>Id</th> > <th>Title</th> > <th>Created</th> > </tr> > <?php foreach ($notes as $note): ?> > <tr> > <td><?php echo $note['Note']['id']; ?></td> > <td> > <a href="/notes/view/<?php echo $note['Note']['id']?>"> > <?php echo $note['Note']['title']?> > </a> > </td> > <td><?php echo $note['Note']['created']; ?></td> > </tr> > <?php endforeach; ?> > </table> > > However, cakePHP threw some errors. I read manual carefully, but it > doesn't mention how could I implement database to the front page. > Please help me. > > Thank you very much ! > Best Regards --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~----------~----~----~----~------~----~------~--~---
