0

我正在使用 cakephp 2.5.4,并尝试创建一个名为 ContactManager 的插件。我在 Plugin 中创建了文件夹 ContactManager,然后分别在 Plugin/ContactManager/Controller 和 Plugin/ContactManager/Model 中创建了两个类 ContactManagerAppController 和 ContactManagerAppModel。然后,我用 loadAll() 加载了 bootstrap.php 中的所有插件。但是当我尝试访问它时出现“缺少控制器”错误(localhost/myapp/ContactManager/SomeController)。我将文件夹的名称更改为contact_manager并尝试通过(localhost/myapp/contact_manager/SomeController)访问它,它工作得很好!我错过了什么?

更新: 对不起,我做了一些测试(localhost/myapp/contact_manager/SomeController)指向 ContactManager 文件夹。只有当我调用 (localhost/myapp/ContactManager/SomeController) 时,我才会收到“缺少控制器”错误。

谢谢,

4

1 回答 1

2

你错过了大会。它写在文档中。您应该使用 snake_case 作为您的网址

所以这是:

/myapp/some_plugin/some_controller/some_action

并映射到

  • SomePlugin 插件
  • SomeController 控制器
  • some_action 动作
于 2014-09-11T10:12:34.047 回答