PrestaShop / PrestaShop/docs

How to use JS router from a a Module?

Open
#554 6 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Scala
Stars
136
Forks
555
Avg merge
4d 14h
Merged PRs (30d)
4

Description

In the migrated page we use FOSRoutingBundle to use the Symfony routes in the frontend (JavaScript).

Example:

this.router.generate('admin_addresses_edit', {
        addressId: address.addressId,
        liteDisplaying: 1,
        submitFormAjax: 1,
      });

We need to document how to use this Router from a module as well. Besides it would be great if modules could add their own routing data, see this issue https://github.com/PrestaShop/PrestaShop/issues/19473

Depending on the state of the core issue when this doc is redacted, also explain how to add routing from your module

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the migrated page's FOSRoutingBundle usage and reviewing core issue #19473 about module routing data. Document how a module uses the JavaScript router, and, if supported by the core issue, how a module adds its own routing data.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, symfony
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.