Missing Controller

I have this error,

“In the case you tried to access a plugin controller make sure you added it to your composer file or you use the autoload option for the plugin.”

Error: Create the class ContactsController below in file: /…/( some PATH) /BASIC/src/Controller/ContactsController.php

Inside ContactsController.php i have those lines!!! FILE EXISTS … and chmod is 777

namespace Custom\Basic\Controller;

use Custom\Basic\Controller\AppController;

class ContactsController extends AppController
{
    public function index()
    {
        //...
    }
}

nobody know why this happen ? … thanks

Case matters. Does the path really have BASIC in it instead of Basic?

Also, is “Custom” part of that path? That seems, well, custom, and I’m not sure whether that sort of structure (putting your src folder two levels down) is supported.

I created the file using touch unix command.

touch /MyUSERDIR/MYPROJECTDIR/plugin/Custom/BASIC/src/Controller/ContactsController.php

I used the path suggested by the exception as command parameter.

Everything works …

  • templates override works
  • routes works
  • cake reveal i’m in the plugin so the path suggested by the exception is right!

Exception Attributes: array (
‘class’ => ‘Contacts’,
‘plugin’ => ‘Custom/Basic’,
‘prefix’ => false,
‘_ext’ => false,
)

Seams even if i have the file with the right path for cake this doesn’t exists.
/MyUSERDIR/MYPROJECTDIR/plugin/custom/BASIC/src/Controller/ContactsController.php

>ls /MyUSERDIR/MYPROJECTDIR/plugin/custom/BASIC/src/Controller/ContactsController.php

return

-rwxrwxrwx 1 myuser mygroup 157B 15 Dic 18:18 ContactsController.php

I would expect the path for this to be /MyUSERDIR/MYPROJECTDIR/plugin/Custom/Basic/src/Controller/ContactsController.php. Note the changes in the case of Custom and Basic. That’s assuming that it’s even possible to call your plugin “Custom/Basic”, which I haven’t ever seen before.

Maybe isn’t a good solution you right but seams it works.

Your expectation (PATH) : 
/plugins/Custom/Basic/src/Controller/ContactsController.php

My solution (PATH)
/plugins/custom/BASIC/src/Controller/ContactsController.php

My folder name “in /plugins” is structure is

custom (parent folder)
- BASIC 
- OTHER FOLDERS

In My Application.php
$this->addPlugin('Custom/BASIC');

My composer.json

"autoload": {
        "psr-4": {
            "App\\": "src/",
            "Custom\\BASIC\\": "./plugins/custom/BASIC/src/",
            "Custom\\BASIC\\Test\\": "./plugins/custom/BASIC/tests/",

MY CAKE PLUGIN COMMAND OUTPUT

bin/cake plugin loaded
Bake
CakePdf
DebugKit
Migrations
WyriHaximus/TwigView!

This is my debug output.

Everything you’re posting here would indicate that it does not, in fact, work. But maybe someone else will be able to help you.