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

Assigner un array depuis un fichier tpl

 
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
chromfr
Smarty n00b


Joined: 16 Dec 2010
Posts: 1

PostPosted: Thu Dec 16, 2010 1:12 am    Post subject: Assigner un array depuis un fichier tpl Reply with quote

Bonjour à tous.

J'essaye de me faire un plugins pour réécriture URL, jusque la je pense avoir reussi a le faire, mais je bloque sur l utilisation de celui ci.

a la place de grand discour je vais vous donnez un exemple

voici comment sont constitués mes url :

index.php?c=controller&a=action&....

depuis la création de mes liens dans les fichiers de template je souhaite pouvoir faire quelque chose comme cela :

Code:
<a href="{rewrite param=array(c=>mon_controller, a=mon_action)}" title="">MON LIEN</a>


seulement je bloque sur le bloque sur le passage des parametres à la fonction, est il possible de faire passer un tableau créer directement dans depuis le fichier tpl et non passé depuis php.

D avance merci
Back to top
View user's profile Send private message
Gowser
Smarty Pro


Joined: 19 Feb 2008
Posts: 104
Location: Nantes (France)

PostPosted: Fri Dec 17, 2010 6:39 pm    Post subject: Reply with quote

Bonsoir / bonjour,

Si tu es en smarty 2 :
Il faudrait que tu passes par le block "{php}{/php}" afin de pouvoir créer un vrai tableau en php puis le passer à ta fonction
Code:

// dans ton template
{php}
$this->assign('tableau', array(c=>mon_controller, a=mon_action));
{/php}

<a href="{rewrite param=$tableau}" title="">MON LIEN</a>


Si tu es en smarty 3 :
Tu peux maintenant créer des tableau dans smarty, ce qui est super simple :
http://www.smarty.net/docs/en/language.builtin.functions.tpl#id3118314

++
_________________
N'oubliez pas de mettre le tag "[Résolu]" sur vos post Smile
Back to top
View user's profile Send private message Send e-mail
Mahindra
Smarty Rookie


Joined: 25 Aug 2011
Posts: 6

PostPosted: Thu Oct 06, 2011 5:27 pm    Post subject: Assigner un array depuis un fichier tpl Reply with quote

Bonjour à tous,

G un petit soucis pour certains fichier fileserve comme Ubuntu et OpenOffice complet auto activation, lorsque jarrive au bout du téléchargement, jd me redemande un captcha et une fois rentré le téléchargement recommence depuis le début. Est ce un problème de fichier?

Merci
Back to top
View user's profile Send private message Send e-mail AIM Address
Gowser
Smarty Pro


Joined: 19 Feb 2008
Posts: 104
Location: Nantes (France)

PostPosted: Tue Nov 15, 2011 12:54 pm    Post subject: Re: Assigner un array depuis un fichier tpl Reply with quote

Mahindra wrote:
Bonjour à tous,

G un petit soucis pour certains fichier fileserve comme Ubuntu et OpenOffice complet auto activation, lorsque jarrive au bout du téléchargement, jd me redemande un captcha et une fois rentré le téléchargement recommence depuis le début. Est ce un problème de fichier?

Merci


A oui, je pense que c'est pas le bon forum pour poser cette question.

Si tu as un problème de machine à laver ou d'hémoroïde, hésite pas à venir poser tes questions ici
_________________
N'oubliez pas de mettre le tag "[Résolu]" sur vos post Smile
Back to top
View user's profile Send private message Send e-mail
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