Skip to content

the js script doesn't generate the same url as symfony (null) #51

@coelhoricardo

Description

@coelhoricardo

hello,
sorry for my english

here it is my route :

MyBundle_indic:
    pattern: /indicateur/{affichage}/{indicateur}/{axey}/{annee}/{period}/{nbperiod}/{type}/{soustype}
    defaults: { _controller: ERDFTourBundle:Indicateur:index, affichage: 'calcul', axey: 'famille', annee : null, period : 'mois', nbperiod : 12, type : null, soustype : null }
    requirements:
        affichage: calcul|liste|image
        axey: "(famille|secteur)?"
        annee: "(\d{4})?"
        period: "(mois|trim)?"
        nbperiod: "(\d{1,2})?"
        type: "(tout|level1|level2)?"
        soustype: ".*"
    options:
        expose: true

Twig code :

{{ path('MyBundle_indic', {
      'soustype': 'tout',
      'affichage': "calcul", 
      'indicateur': 'test',
      'axey': "famille",
      'period': "mois" }) }}

generate :
/app_dev.php/indicateur/calcul/test/famille//mois/12//tout

JS code :

Routing.generate('MyBundle_indic', {
      'soustype': 'tout',
      'affichage': "calcul", 
      'indicateur': 'test',
      'axey': "famille",
      'period': "mois" })

generate:
/app_dev.php/indicateur/calcul/test/famille/null/mois/12/null/tout

Thanks in advance

NB: default value 'null' should be considered as a empty string

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions