|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Globetrotter Smarty n00b
Joined: 15 Oct 2017 Posts: 2
|
Posted: Sun Oct 15, 2017 5:02 pm Post subject: Utiliser une fonction php dans un template |
|
|
Bonjour à tous!
Je suis entrain d'apprendre ce language que je trouve très interressant.
Je réussis à me débrouiller pour la plupart de mes interogations mais là je tombe sur un tit soucis que je n'arrive pas à résoudre.
Je réécris un projet complet qui est en procédural! JE sais pas si vous voyez le bordel^^
Je le passe en po avec architecture mvc sans passer par cake, ou symfony, etc, etc. BREF
j'ai besoin d'un petit coup de pouce concernant l'utilisation d'une simple fonction externe.
j'ai une fonction mafonction($id) qui est située dans un fichier de fonctions.
Je voudrais l'importer et l'utiliser telle quelle dans un template.
Cette fonction toute bete retourne un resultat selon l'id.
Je n'ai pas vu de tag qui permet cela. J'ai essayé le mode compatibilité avec smartbc et les tag {php} mais ca ne me donne pas le resultat escompté.
JE l'ai utilisé comme cela {php} mafonction($id) {/php}
YA t'il un autre moyen ou peut être j'ai mal fait.
Merci de votre aide.
Last edited by Globetrotter on Sun Oct 15, 2017 5:59 pm; edited 1 time in total |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
|
Back to top |
|
Globetrotter Smarty n00b
Joined: 15 Oct 2017 Posts: 2
|
Posted: Sun Oct 15, 2017 5:52 pm Post subject: |
|
|
Hello. i have read your post.Thank's for your reply. I have found with modifiers. Have a good day. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|