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



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


Joined: 17 Jun 2018
Posts: 2

PostPosted: Sun Jun 17, 2018 9:24 pm    Post subject: Reply with quote

Bonjour,

Je voudrait découper en 2 le contenu d'une variable dans un template. (en séparant le contenu par un --)

Cette variable, $image.legend

Hors pour ce faire, je pourrait utiliser ce code (à votre avis ?)

Code:
 $coupure = explode ("--", $image.legend);


Ensuite afficher les 2 morceaux avec

Code:
 $coupure[0];
 $coupure[1];


Mais comment j’intègre cette commande dans mon template ?

Code:
{$image.legend}


Merci pour votre aide.
Back to top
View user's profile Send private message
polosmarty
Smarty n00b


Joined: 17 Jun 2018
Posts: 2

PostPosted: Sun Jun 17, 2018 9:49 pm    Post subject: Reply with quote

polosmarty wrote:
Bonjour,

Je voudrait découper en 2 le contenu d'une variable dans un template. (en séparant le contenu par un --)

Cette variable, $image.legend

Hors pour ce faire, je pourrait utiliser ce code (à votre avis ?)

Code:
 $coupure = explode ("--", $image.legend);


Ensuite afficher les 2 morceaux avec

Code:
 $coupure[0];
 $coupure[1];


Mais comment j’intègre cette commande dans mon template ?

Code:
{$image.legend}


Merci pour votre aide.


Ah c'est bon j'ai trouvé !!

Code:
  {$decoupe = explode('--', $image.legend)}


Merci pour ce forum grandement utile. Razz
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