私はケーキに不慣れで、ベーキング中にいくつかの問題があります...私はMAcOSのMAMPサーバーでケーキphp2.2.1を使用しています。私は複数/単一の感染器をオフにしました...そして私はいくつかのテーブルを焼こうとします:
CREATE TABLE users (
id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(255) NOT NULL UNIQUE,
password CHAR(40) NOT NULL,
email VARCHAR(40) NOT NULL,
group_id INT(11) NOT NULL,
created DATETIME,
modified DATETIME
);# MySQL returned an empty result set (i.e. zero rows).
CREATE TABLE users_groups (
id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100) NOT NULL,
created DATETIME,
modified DATETIME
);# MySQL returned an empty result set (i.e. zero rows).
CREATE TABLE novosti (
id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
url VARCHAR(255) NOT NULL UNIQUE KEY,
user_id INT(11) NOT NULL,
title VARCHAR(255) NOT NULL,
body TEXT,
published INT(1) DEFAULT 1,
created DATETIME,
modified DATETIME
);# MySQL returned an empty result set (i.e. zero rows).
CREATE TABLE meta (
id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
controller VARCHAR(255) NOT NULL UNIQUE KEY,
action_name VARCHAR(255) NOT NULL,
action_id VARCHAR(255),
title VARCHAR(255) NOT NULL,
keywords VARCHAR(255) NOT NULL,
description VARCHAR(255) NOT NULL,
created DATETIME,
modified DATETIME
);# MySQL returned an empty result set (i.e. zero rows).
したがって、「すべてをケーキベイク」-「users_groups」の場合はエラーは発生しませんが、他の3つのテーブルを「すべてケーキベイク」の場合は同じエラーが発生するため、モデルとコントローラーファイルは取得しますが、ビューファイルは取得しません...したがって、問題はビューファイルのベイク処理にあります。コンソールログは次のとおりです。
What would you like to Bake? (D/M/V/C/P/F/T/Q)
> v
---------------------------------------------------------------
Bake View
Path: /Applications/MAMP/htdocs/app/View/
---------------------------------------------------------------
Use Database Config: (default/test)
[default] >
Possible Controllers based on your current database:
---------------------------------------------------------------
1. Meta
2. Novosti
3. Users
4. UsersGroups
Enter a number from the list above,
type in the name of another controller, or 'q' to exit
[q] > 1
Would you like bake to build your views interactively?
Warning: Choosing no will overwrite Meta views if it exist. (y/n)
[n] > y
Would you like to create some CRUD views
(index, add, view, edit) for this controller?
NOTE: Before doing so, you'll need to create your controller
and model classes (including associated models). (y/n)
[y] > y
Would you like to create the views for admin routing? (y/n)
[n] > n
Error: Table action for model Action was not found in datasource default.
#0 /Applications/MAMP/htdocs/lib/Cake/Model/Model.php(3180): Model->setSource('action')
#1 /Applications/MAMP/htdocs/lib/Cake/Model/Model.php(1301): Model->getDataSource()
#2 /Applications/MAMP/htdocs/lib/Cake/Model/Model.php(1389): Model->schema()
#3 /Applications/MAMP/htdocs/lib/Cake/Model/Model.php(1375): Model->hasField('title', false)
#4 /Applications/MAMP/htdocs/lib/Cake/Model/Model.php(863): Model->hasField(Array)
#5 /Applications/MAMP/htdocs/lib/Cake/Console/Command/Task/ViewTask.php(459): Model->__get('displayField')
#6 /Applications/MAMP/htdocs/lib/Cake/Console/Command/Task/ViewTask.php(284): ViewTask->_associations(Object(Meta))
#7 /Applications/MAMP/htdocs/lib/Cake/Console/Command/Task/ViewTask.php(223): ViewTask->_loadController()
#8 /Applications/MAMP/htdocs/lib/Cake/Console/Command/Task/ViewTask.php(90): ViewTask->_interactive()
#9 /Applications/MAMP/htdocs/lib/Cake/Console/Command/BakeShell.php(110): ViewTask->execute()
#10 /Applications/MAMP/htdocs/lib/Cake/Console/Command/BakeShell.php(131): BakeShell->main()
#11 /Applications/MAMP/htdocs/lib/Cake/Console/Command/BakeShell.php(131): BakeShell->main()
#12 /Applications/MAMP/htdocs/lib/Cake/Console/Shell.php(393): BakeShell->main()
#13 /Applications/MAMP/htdocs/lib/Cake/Console/ShellDispatcher.php(201): Shell->runCommand(NULL, Array)
#14 /Applications/MAMP/htdocs/lib/Cake/Console/ShellDispatcher.php(69): ShellDispatcher->dispatch()
#15 /Applications/MAMP/htdocs/app/Console/cake.php(33): ShellDispatcher::run(Array)
#16 {main}
plzみんなを助けて%)