THELIA Forum

Welcome to the THELIA support and discusssion forum

Announcement

Rejoignez la communauté sur le Discord Thelia : https://discord.gg/YgwpYEE3y3

Offline


Bonjour,

J'ai défini une route du genre : /article/{id_article}

Comment générer ma route dans mon template avec par exemple l'ID 123 ? (pour avoir /article/123 et pas /article/?id_article=123)
Je sais c'est la base mais je suis un peu perdu...et la doc est pauvre...

Merci wink

Last edited by FredoVelcro (05-06-2014 14:21:31)

  • manu
  • faï tot petar miladiu

Offline


{url path="/article/{$ta_variable_id}"}

La doc est peut être pauvre mais elle couvre ce chapitre :-p http://doc.thelia.net/en/documentation/ … paths.html


http://doc.thelia.net/
http://thelia.net/modules
http://raynaud.io
PGP public Key : 0xC6E546A6

Offline


Oui j'ai bien lu ça...mais vu que ma route est définie ainsi :

<route id="article.show" path="/articles/{article_id}/{article_slug}" methods="get">
        <default key="_controller">MonSite\MonController::showArticleAction</default>
    </route>

J'ai l'habitude d'utiliser Symfony2 avec.. Twig... alors je cherche l'équivalent Smarty d'un :
path("article.show", [article_id: 123, article_slug: 'mon-super-article'])

(avec le nom de la route)

Last edited by FredoVelcro (05-06-2014 14:20:24)

  • manu
  • faï tot petar miladiu

Offline


En effet nous n'avons pas encore d'équivalent, c'est notamment du au fait que nous utilisons une collection de router mais je suppose que c'est réalisable.


http://doc.thelia.net/
http://thelia.net/modules
http://raynaud.io
PGP public Key : 0xC6E546A6