Finally, I called composer dump-autoload in order to publish my Controller to the autoloader (if I got that right). Then I activated my module in the admin backend.
What I expected: When calling the URL above, Iâd like to see the âHello world!â on screen.
What I got: Redirect to Shop.
The oxideshop.log has logged an exception: EXCEPTION_SYSTEMCOMPONENT_CLASSNOTFOUND MyVendor\MyModule\MyController
I think the code you posted first is almost correct except:
there should be a semicolon in the controller after the namespace
in metadata, the âControllerâ-Folder is missing in the namespace. Should be the same as in the Controller: MyVendor\MyModule\Controller\MyController::class
As mentioned the Controller should extend the default frontend controller
you are probably doing it right, but cloudflare firewall is blocking it very often.
Thats a common problem also with other forums, too, but there is no solution so far (except disabling firewall and opening our virtual doors for all the spam bots.)
In the meantime i suggest using external services like pastebin or gists
Thatâs because you didnât modify an existing controller (e.g. ArticleListController), but you created a new one. If you modify an existing class, you have to use the âextendsâ array in metadata. If you create your own class, this used to be registered in the âfilesâ array. âFilesâ is not needed anymore (autoloading), so now you have âcontrollersâ to define a name for the âclâ-parameter. Your own classes (in âfilesâ or in âcontrollersâ) do not appear in the âloaded modulesâ list, only the ones that modify an existing class.