Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Utiliser une fonction php dans un template

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: French
View previous topic :: View next topic  
Author Message
Globetrotter
Smarty n00b


Joined: 15 Oct 2017
Posts: 2

PostPosted: Sun Oct 15, 2017 5:02 pm    Post subject: Utiliser une fonction php dans un template Reply with quote

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
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Sun Oct 15, 2017 5:22 pm    Post subject: Reply with quote

1. Don't use SmartyBC.
2. https://www.smarty.net/forums/viewtopic.php?p=92848#92848
Back to top
View user's profile Send private message
Globetrotter
Smarty n00b


Joined: 15 Oct 2017
Posts: 2

PostPosted: Sun Oct 15, 2017 5:52 pm    Post subject: Reply with quote

Hello. i have read your post.Thank's for your reply. I have found with modifiers. Have a good day.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: French All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP