# Can't reach plugin controller

**URL:** <https://discourse.cakephp.org/t/cant-reach-plugin-controller/9882>\
**Category:** Need Help\
**Created:** [November 3, 2021, 3:04pm UTC](https://discourse.cakephp.org/t/cant-reach-plugin-controller/9882 "2021-11-03T15:04:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tdhooge](https://avatars.discourse-cdn.com/v4/letter/t/4da419/32.png) [@tdhooge](https://discourse.cakephp.org/u/tdhooge)\
**Post date:** [November 3, 2021, 3:04pm UTC](https://discourse.cakephp.org/t/cant-reach-plugin-controller/9882/1 "2021-11-03T15:04:45Z")

</div>

Hey,

I just baked a plugin and put a controller inside … but I can’t reach it. Its says to create the controller, but it is already there

So i get " **Error** _Test.ContactsController_ could not be found." with " **Suggestion** Create the class _ContactsController_ below in file: D:\cakephp/plugins/Test/src\Controller\ContactsController.php"

ContactsController.php is in that location and has the right stuff inside (even tried just copying the suggestion)

The plugin routing seems fine, as it sees that the url i try is for the plugin.

The plugin gets loaded in the bootstrap part of application.php, and to me it looks like it actually does this. I see it in the “includes” part of the debug toolbar and the routes are loaded too.

I don’t see what i’m doing wrong. The only thing “off” i see are the directory seperators in the filepath

Can anyone help?

---

<div class="post-metadata">

**Author:** ![tdhooge](https://avatars.discourse-cdn.com/v4/letter/t/4da419/32.png) [@tdhooge](https://discourse.cakephp.org/u/tdhooge)\
**Post date:** [November 5, 2021, 8:20am UTC](https://discourse.cakephp.org/t/cant-reach-plugin-controller/9882/2 "2021-11-05T08:20:23Z")

</div>

So … I didn’t give up.

In the docs ( [Plugins - 4.x (cakephp.org)](https://book.cakephp.org/4/en/plugins.html) ) it says " If you install your plugins via `composer` or `bake` you shouldn’t need to configure class autoloading for your plugins."

But apparantly when i baked the plugin it said "Do you want to overwrite? (y/n/a/q)  
[n] \> Skip `D:\cakephp\composer.json`" … (it skipped automaticaly)

So i did have to manually add the plugin to the autoload stuff in composer.json.

That worked.

---

<div class="post-metadata">

**Author:** ![KevinPfeifer](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/kevinpfeifer/32/3365_2.png) [@KevinPfeifer](https://discourse.cakephp.org/u/KevinPfeifer)\
**Post date:** [November 5, 2021, 12:57pm UTC](https://discourse.cakephp.org/t/cant-reach-plugin-controller/9882/3 "2021-11-05T12:57:03Z")

</div>

Basically what is stated here:

[https://book.cakephp.org/4/en/plugins.html#manually-autoloading-plugin-classes](https://book.cakephp.org/4/en/plugins.html#manually-autoloading-plugin-classes)
