1

我手动安装了一个插件,但在我的 URL 地址中看到一个错误:

http://localhost/cake3/contact-manager/contacts

    Error: ContactManager.ContactsController could not be found.

    Error: Create the class ContactsController below in file: D:\www\cake3\plugins\ContactManager\src\Controller\ContactsController.php

    <?php
    namespace ContactManager\Controller;

    use ContactManager\Controller\AppController;

    class ContactsController extends AppController
    {

    }

我的文件:

http://book.cakephp.org/3.0/en/plugins.htm

在 config: 'composer.json' 中添加这一行:

 "autoload": {
       "psr-4": {
           "App\\": "src",
           "ContactManager\\": "./plugins/ContactManager/src", 
       }
   }, 

在文件中:'config\bootstrap.php' 添加了这一行:

Plugin::load('ContactManager', ['routes' => true]); 
4

0 回答 0