amit_2006_it
2008-07-24 17:00:00 UTC
Hi,
I am new to cakePHP world that's why i try to started with the blog
tutorial shown on cakephp.org. But whenever i hit the browser with
http://localhost/cakeBlog/posts/index,
i get an error "Not Found. The requested URL /cakeBlog/posts/index was
not found on this server.".
Here is what i made to get it worked....
1. first created the app/models/post.php
=> class Post extends AppModel
{
var $name = "Post";
}
2. Secondly, add controller in app/controllers/posts_controller.php
=> class PostsController extends AppController
{
$name = "Posts";
function index()
{
$this->set("posts", $this->Post->findAll());
}
}
3. Finally print the array assign to "posts" variable in controller
page shown above in app/views/posts/index.ctp
=> print_r($posts);
Now as it is exactly shown in the blog tutorial on cakephp.org, it
should work.
But its not. And i wasted lot of time to find out what went wrong.
Please tell me, is there something wrong in this code?
Thank you,
Amit Gharat
amit.2006.it-dVM3bRS+***@public.gmane.org
I am new to cakePHP world that's why i try to started with the blog
tutorial shown on cakephp.org. But whenever i hit the browser with
http://localhost/cakeBlog/posts/index,
i get an error "Not Found. The requested URL /cakeBlog/posts/index was
not found on this server.".
Here is what i made to get it worked....
1. first created the app/models/post.php
=> class Post extends AppModel
{
var $name = "Post";
}
2. Secondly, add controller in app/controllers/posts_controller.php
=> class PostsController extends AppController
{
$name = "Posts";
function index()
{
$this->set("posts", $this->Post->findAll());
}
}
3. Finally print the array assign to "posts" variable in controller
page shown above in app/views/posts/index.ctp
=> print_r($posts);
Now as it is exactly shown in the blog tutorial on cakephp.org, it
should work.
But its not. And i wasted lot of time to find out what went wrong.
Please tell me, is there something wrong in this code?
Thank you,
Amit Gharat
amit.2006.it-dVM3bRS+***@public.gmane.org