Hi Amit, > 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 > withhttp://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?
No, the code looks fine. If you call localhost/cakeBlog, does the shown page use any styles? If no, it is probably an issue with mod_rewrite, see http://book.cakephp.org/view/333/a-note-on-mod_rewrite Hope that helps! -- Daniel Hofstetter http://cakebaker.42dh.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
