2011-12-08 7 views
0

(私はHAVAを逃したことがあり、何か)は、私はあなたが正しい方向に私を指すことがない限り、私は規則を次のです..私はケーキPHPに新しいですし、これは私に問題を与えている設定

を私の見解を認識しませんこのコントローラ

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'; 
    } 
    } 
?> 

MODEL

dish_category.php

012を有しています
<?php 
class DishCategory extends AppModel{ 

    var $name = 'DishCategory'; 
} 
?> 

VIEW

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

が、私はこの問題についてあなたの助けをいただければ幸いです。この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 

と、次のエラーを取得

は、エラーがあるあなたに

答えて

1

ありがとうございました明白:

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

ビューの名前はアクション名と同じにする必要があります。すなわちget_categories.ctpではなく、dish_categories.ctpになりました。

編集:

htdocs\myweb\app\views\dish__categories\ 

がdish__categories

で2アンダースコアは、この行を削除しようとしています

var $name = 'Dish_Categories'; 
+0

実は私はちょうどそれが修正されました、それをmisstyped get_categoriesとしてそれを持っています。もしあなたが何かを見たら私に知らせてください – user710502

+0

魅力のように働いてくれてありがとう – user710502

関連する問題