Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6911287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:55:59+00:00 2026-05-27T08:55:59+00:00

I am new to Cake PHP and this set up is giving me a

  • 0

I am new to Cake PHP and this set up is giving me a problem.. i am following the conventions unless you may point me in the right direction (something i may hava missed)

I have this controller

dish_categories_controller.php

<?php
class DishCategoriesController extends AppController {

    var $name = 'Dish_Categories';

    var $uses = array("DishCategory");

    function get_categories($id)
    {
       $this->set('dish_categories',$this->DishCategory->find('first', array('conditions' => array('DishCategory.category_id' == $id))));
       $this->layout = 'master_layout';
    }   
  }
?>

THE MODEL

dish_category.php

<?php
class DishCategory extends AppModel{

    var $name = 'DishCategory';
 }
?>

VIEW

foder:  dish_categories
file:  get_categories.ctp
<?php
print_r($dish_categories);
?>

But i get the following error with this url

myweb/app/dish_categories/get_categories/1


Error: The view for Dish_CategoriesController::get_categories() was not found.

Error: Confirm you have created the file: C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\myweb\app\views\dish__categories\get_categories.ctp

I would appreciate your help on this matter

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T08:56:00+00:00Added an answer on May 27, 2026 at 8:56 am

    The error is obvious:

    Confirm you have created the file: C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\myweb\app\views\dish__categories\get_categories.ctp
    

    Your view must have the same name as the action name. i.e. get_categories.ctp, not dish_categories.ctp like it is now.

    edit:

    htdocs\myweb\app\views\dish__categories\
    

    has 2 underscores in dish__categories

    try to remove this line:

    var $name = 'Dish_Categories';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi i am new in cake php and can't solve the problem. The problem
I need to add new functionalities into /cake/libs/controller/pages_controller.php but I do not want to
I am new to Cake PHP, in regular PHP I had a index.php and
I am new to Cake PHP and I had a website with regular PHP
I have this data spited out from my cake php query.. This is the
I'm new to cakephp and following this tutorial. http://book.cakephp.org/2.0/en/tutorials-and-examples/blog-auth-example/auth.html I have created the blog
I'm new to cakephp and following this tutorial for a user authentication system http://bakery.cakephp.org/articles/SeanCallan/2007/04/17/simple-form-authentication-in-1-2-x-x
I am new to cakephp and I'm trying to accomplish something that should be
New to javascript/jquery and having a hard time with using this or $(this) to
I'm trying to get this loop to save a new record to the database

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.