Hello,

I attempted to resolve this issue with all posts I could find in
relation, but the same error persisted.

First off, this is my 1st time using cake, and I am "playing" with the
"The Cake Blog Tutorial".

I created all files up to the test area (where I can view the post
data extracted from the db). And I am trying to view the data but
continue to run into this error:

========= MSG START ===================

Missing controller

You are seeing this error because controller PostsController could not
be found.

Notice: If you want to customize this error message, create app/views/
errors/missing_controller.thtml.

Fatal: Create the class below in file : app/controllers/
posts_controller.php

<?php
class PostsController extends AppController {
   var $name = 'Posts';
}
?>

========== MSG END ==================

Here is my code and main files & code:

-------------------------------
***posts_controller.php***
-------------------------------
<?php

class PostsController extends AppController {
    var $name = 'Posts';
    function index()
        {
          $this->set('posts', $this->Post->findAll());
    }

    function view($id = null)
    {
        $this->Post->id = $id;
        $this->set('post', $this->Post->read());
    }
}

?>
-------------------------------
***post.php***
-------------------------------
<?php

class Post extends AppModel
{
    var $name = 'Post';
}

?>
-------------------------------
***index.thtml***
-------------------------------
<h1>Blog posts</h1>
<table>
    <tr>
        <th>Id</th>
        <th>Title</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 $post['Post']['created']; ?></td>
    </tr>
    <?php endforeach; ?>

</table>


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to