久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

在默認數(shù)據(jù)源中找不到模型的 cakephp 表

cakephp Table for model was not found in datasource default(在默認數(shù)據(jù)源中找不到模型的 cakephp 表)
本文介紹了在默認數(shù)據(jù)源中找不到模型的 cakephp 表的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我的數(shù)據(jù)庫中只有一個名為ficha_seg"的表.我的模型文件名為Ficha.php",控制器名為FichasController.php".

那么,為什么我會收到錯誤:

錯誤:在默認數(shù)據(jù)源中找不到模型 Ficha 的表 fichas.

像這樣配置我的控制器的 index() 方法后:

 公共函數(shù) index() {$this->set('ficha_seg', $this->Ficha->find('all'));}

解決方案

默認情況下,模型使用模型類名的小寫復(fù)數(shù)形式作為數(shù)據(jù)庫表名.

如果你需要為你的模型使用另一個表名,你可以使用useTable屬性:

class Ficha 擴展 AppModel{公共 $useTable = 'ficha_seg';}

參見 http://book.cakephp.org/2.0/en/models/模型屬性.html#usetable和Cookbook 中的模型約定>

I have just a table on my database named "ficha_seg". The name of my model file is "Ficha.php" and the name of the controller is "FichasController.php".

So, why i'm getting the error:

Error: Table fichas for model Ficha was not found in datasource default.

after configured my index() method of controller like this:

 public function index() {
    $this->set('ficha_seg', $this->Ficha->find('all'));
}

解決方案

By default, the model uses the lowercase, plural form of the model’s class name for the database table name.

If you need to use another table name for your model, you can use the useTable attribute:

class Ficha extends AppModel 
{
    public $useTable = 'ficha_seg';
}

See http://book.cakephp.org/2.0/en/models/model-attributes.html#usetable and Model conventions in the Cookbook

這篇關(guān)于在默認數(shù)據(jù)源中找不到模型的 cakephp 表的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Cannot use #39;Object as class name as it is reserved Cake 2.2.x(不能使用 Object 作為類名,因為它是保留的 Cake 2.2.x)
Session is lost after an OAuth redirect(OAuth 重定向后會話丟失)
Pagination Sort in Cakephp 3.x(Cakephp 3.x 中的分頁排序)
CakePHP Shared core for multiple apps(CakePHP 多個應(yīng)用程序的共享核心)
Login [ Auth-gt;identify() ] always false on CakePHP 3(在 CakePHP 3 上登錄 [ Auth-identify() ] 始終為 false)
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 87 bytes)(致命錯誤:允許的內(nèi)存大小為 134217728 字節(jié)已用盡(嘗試分配 87 字節(jié)))
主站蜘蛛池模板: 久久国产一区二区三区 | 高清av一区 | 国产精品一区二区欧美 | 中文字幕中文字幕 | 欧美日韩国产一区二区 | 欧美国产一区二区三区 | 国产精品国产成人国产三级 | 在线观看国产 | 国产女人与拘做受免费视频 | 欧美日韩在线免费 | 亚洲国产精品久久久 | 91亚洲精品久久久电影 | 亚洲品质自拍视频网站 | 中文字幕成人av | 久久日韩精品一区二区三区 | 成人小视频在线观看 | 中文字幕蜜臀av | 日本精品裸体写真集在线观看 | 91精品国产自产精品男人的天堂 | 97精品超碰一区二区三区 | 欧美国产精品 | 一级免费毛片 | 国产成人在线一区 | 久久高清精品 | 亚洲欧美日本国产 | 精品久久久久久久 | 国产欧美日韩精品一区 | 国产在线播 | 欧美亚州综合 | 在线一区二区三区 | 日韩精品在线观看视频 | 午夜电影福利 | 青青久久 | 日韩亚洲视频 | 欧美一级大片免费观看 | 久久男人天堂 | 国产精品av久久久久久久久久 | 久久日韩粉嫩一区二区三区 | 久久久www成人免费精品 | 亚洲香蕉在线视频 | 亚洲激情网站 |