【问题标题】:Is there something wrong with cakephp plugin naming convention?cakephp插件命名约定有问题吗?
【发布时间】:2014-09-11 10:05:38
【问题描述】:

我正在使用 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) 时,我才会收到“缺少控制器”错误。

谢谢,

【问题讨论】:

    标签: cakephp cakephp-2.5


    【解决方案1】:

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

    原来如此:

    /myapp/some_plugin/some_controller/some_action
    

    并映射到

    • SomePlugin 插件
    • SomeController 控制器
    • some_action 动作

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-01-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多