【发布时间】:2020-11-08 10:04:07
【问题描述】:
我没有找到任何关于这个的东西,所以我问你们,
当我使用这样的命令cake bake 创建控制器时:
cake bake controller --prefix manager accounts
Cake 会自动在其中创建一个控制器和 4 个常规功能/َaction,
在错误管理部分(称为 Flash)有这一行:
$this->Manager->error(__('The account could not be deleted. Please, try again.'));
在一个典型的控制器中是这样的:
$this->Flash->error(__('The account could not be deleted. Please, try again.'));
所以我可以很容易地用 Flash 更改它并且它工作正常,而且我还知道我是否在前缀文件夹中创建此路径:Template \ Manager \ Element \ Flash \ (3 files) by cake as 默认“经理”用于此前缀,但如果我使用$this-> 闪现!不是来自 $this>Manager...
我的问题是如果蛋糕配置Manager而不是Flash,它必须有一个程序,但我找不到它的来源,如果我想完全使用Manager,有谁知道我该怎么做蛋糕呢?
任何提示都会有所帮助,即使是源链接 提前致谢
【问题讨论】:
-
CakePHP,分别是 Bake,不会生成这样的代码,the bake templates 中的
$this->Flash->error()行是硬编码的,看起来它一直都是。 -
@ndm 你是对的人,我的蛋糕似乎有问题。我重新安装了它,这个问题不再发生,或者我用其他命令点击它并再次离开管理器!非常感谢您的帮助:x
标签: php cakephp cakephp-3.0