0

似乎在任何地方都没有关于它的文档。任何帮助将不胜感激。

4

2 回答 2

1

该文档可在http://book.cakephp.org/2.0/en/console-and-shells.html获得。根据 OP 的建议将此添加为答案。

于 2015-11-09T11:19:28.137 回答
1

如果我没记错的话,您的意思是 Cake Console 和 Shell,它可以为您的应用程序生成控制器、模型和视图的自动生成代码。

您可以参考此处了解更多信息http://book.cakephp.org/2.0/en/console-and-shells.html

你可以使用'bake'shell 来生成你的 mvc 结构。

例子:

$cake bake all

将在您的数据库中输出所有可能的表,如下所示

---------------------------------------------------------------
Bake All
---------------------------------------------------------------
Possible Models based on your current database:
1.posts
2.users
Enter a number from the list above,
type in the name of another model, or 'q' to exit

如果你输入 1,那么结果将如下所示:

Baking `index` view file...

Creating file /Applications/XAMPP/htdocs/AQMCorporate/aqmtest/View/Posts/index.ctp
Wrote `/Applications/XAMPP/htdocs/AQMCorporate/aqmtest/View/Posts/index.ctp`

Baking `view` view file...

Creating file /Applications/XAMPP/htdocs/AQMCorporate/aqmtest/View/Posts/view.ctp
Wrote `/Applications/XAMPP/htdocs/AQMCorporate/aqmtest/View/Posts/view.ctp`

Baking `add` view file...

Creating file /Applications/XAMPP/htdocs/AQMCorporate/aqmtest/View/Posts/add.ctp
Wrote `/Applications/XAMPP/htdocs/AQMCorporate/aqmtest/View/Posts/add.ctp`

Baking `edit` view file...

Creating file /Applications/XAMPP/htdocs/AQMCorporate/aqmtest/View/Posts/edit.ctp
Wrote `/Applications/XAMPP/htdocs/AQMCorporate/aqmtest/View/Posts/edit.ctp`

Bake All complete

CakePHP 控制台和 shell 就到这里了。

于 2015-11-09T14:17:47.203 回答