PrestaShop/docs

documentation module example produces an error

aymeric75 opened this issue · 3 comments

Hello,

The example from this page here

produces an error when we try to access the module configuration:




Unable to generate a URL for the named route "demo_configuration_form_simple" as such route does not exist.

[Symfony\Component\Routing\Exception\RouteNotFoundException 0]

[EDIT] also the Modern configuration page section is not very enlightning, there is no explanation showing that this (very intricate) code has advantages over the legacy architecture (this is why I wanted to see the result in the back office, but there is the error). For instance, is there any advantage of using this new code if we plan to use Vue.js in a module admin page ?

Hello,

Did you registered your route as explained in this section: https://devdocs.prestashop-project.org/8/modules/creation/adding-configuration-page-modern/#create-a-route-for-the-configuration-controller

Also, did you ran composer dump-autoload from your module directory ? https://devdocs.prestashop-project.org/8/modules/creation/adding-configuration-page-modern/#create-the-base-module

For the second topic about legacy vs modern advantages, i may think about it to add a short summary. 👍

Hi @aymeric75

What version of PrestaShop do you use?

Hello and thanks for your answers, I think I already solved this, indeed was missing the route in the routes.yml . I am on Prestashop 8, having new features and ways of coding is cool but having an explanation on why we should use it would be awesome.