IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Bibliothèques et frameworks PHP Discussion :

[Smarty] html_select et balise html font


Sujet :

Bibliothèques et frameworks PHP

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre éclairé
    Homme Profil pro
    Enseignant
    Inscrit en
    Avril 2002
    Messages
    329
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 51
    Localisation : France, Vosges (Lorraine)

    Informations professionnelles :
    Activité : Enseignant
    Secteur : Enseignement

    Informations forums :
    Inscription : Avril 2002
    Messages : 329
    Par défaut [Smarty] html_select et balise html font
    Bonjour,

    Un petit souci technique avec smarty !

    Je souhaite créer une boite de sélection en utilisant html_select

    Dans le fichier php
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    $smarty->assign('nom_police', array("Arial",
    									"Tahoma",
    									"Helvetica",
    									"Verdana",
    									"Impact",
    									"Courier",
    									"Courier New",
    									"Lucida Sans",
    									"Trebuchet MS"));
    $smarty->assign('type_police', array("<font style='font-family:Arial'>Arial</font>",
    									"<font style='font-family:Tahoma'>Tahoma</font>",
    									"<font style='font-family:Helvetica'>Helvetica</font>",
    									"<font style='font-family:Verdana'>Verdana</font>",
    									"<font style='font-family:Impact'>Impact</font>",
    									"<font style='font-family:Courier'>Courier</font>",
    									"<font style='font-family:Courier New'>Courier New</font>",
    									"<font style='font-family:Lucida Sans'>Lucida Sans</font>",
    									"<font style='font-family:Trebuchet MS'>Trebuchet MS</font>"));
    Dans le fichier tpl
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <select name="tm_input1" size="1">{html_options values=$nom_police output=$type_police}</select>
    Mais la boite de sélection m'affiche un résultat du type:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    ...
    <font style='font-family:Lucida Sans'>Lucida Sans</font>
    ...
    alors que je désire obtenir une liste des polices écrites dans leur propre police !

    Le code html ainsi créé est :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    <select name="tm_input1" size="1"><option label="&lt;font style='font-family:Arial'&gt;Arial&lt;/font&gt;" value="Arial">&lt;font style='font-family:Arial'&gt;Arial&lt;/font&gt;</option>
    <option label="&lt;font style='font-family:Tahoma'&gt;Tahoma&lt;/font&gt;" value="Tahoma">&lt;font style='font-family:Tahoma'&gt;Tahoma&lt;/font&gt;</option>
    <option label="&lt;font style='font-family:Helvetica'&gt;Helvetica&lt;/font&gt;" value="Helvetica">&lt;font style='font-family:Helvetica'&gt;Helvetica&lt;/font&gt;</option>
    <option label="&lt;font style='font-family:Verdana'&gt;Verdana&lt;/font&gt;" value="Verdana">&lt;font style='font-family:Verdana'&gt;Verdana&lt;/font&gt;</option>
    <option label="&lt;font style='font-family:Impact'&gt;Impact&lt;/font&gt;" value="Impact">&lt;font style='font-family:Impact'&gt;Impact&lt;/font&gt;</option>
    <option label="&lt;font style='font-family:Courier'&gt;Courier&lt;/font&gt;" value="Courier">&lt;font style='font-family:Courier'&gt;Courier&lt;/font&gt;</option>
    <option label="&lt;font style='font-family:Courier New'&gt;Courier New&lt;/font&gt;" value="Courier New">&lt;font style='font-family:Courier New'&gt;Courier New&lt;/font&gt;</option>
    <option label="&lt;font style='font-family:Lucida Sans'&gt;Lucida Sans&lt;/font&gt;" value="Lucida Sans">&lt;font style='font-family:Lucida Sans'&gt;Lucida Sans&lt;/font&gt;</option>
    <option label="&lt;font style='font-family:Trebuchet MS'&gt;Trebuchet MS&lt;/font&gt;" value="Trebuchet MS">&lt;font style='font-family:Trebuchet MS'&gt;Trebuchet MS&lt;/font&gt;</option>
    </select>
    Pouvez-vous m'aider ?

    Merci

  2. #2
    Modérateur
    Avatar de sabotage
    Homme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    29 208
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Juillet 2005
    Messages : 29 208
    Par défaut
    Bonjour,

    html_select convertissant les guillemets en entités HTML, tu ne pourras pas discretement lui glisser des balises HTML.
    Il va falloir construire ta liste avec {foreach}
    N'oubliez pas de consulter les FAQ PHP et les cours et tutoriels PHP

Discussions similaires

  1. variables dynamiques de smarty entre les balises de HTML
    Par hassna.kaibous dans le forum Autres langages pour le Web
    Réponses: 1
    Dernier message: 01/07/2008, 10h33
  2. XSLT et balise HTML div
    Par haypo dans le forum XSL/XSLT/XPATH
    Réponses: 6
    Dernier message: 01/07/2003, 20h38
  3. problème xsl : inclure une donnée xml dans une balise html
    Par djodjo dans le forum XSL/XSLT/XPATH
    Réponses: 3
    Dernier message: 03/01/2003, 09h24
  4. Balises HTML dans un fichier XML
    Par Bastet79 dans le forum XML/XSL et SOAP
    Réponses: 12
    Dernier message: 04/09/2002, 15h29
  5. [XSLT] inclure du XSL dans une balise html
    Par iaa dans le forum XSL/XSLT/XPATH
    Réponses: 2
    Dernier message: 05/08/2002, 15h57

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo