PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > php.smarty.general > html_options is possible to do that ?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
html_options is possible to do that ?

Réponse
 
LinkBack Outils de la discussion
Vieux 09/02/2006, 19h16   #1
Danilo Buerger
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [SMARTY] html_options is possible to do that ?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

http://smarty.php.net/manual/en/lang...ml.options.php

You need an associative array. Just fill $arrCat with IDC as keys and
CNombre as values. Then use {html_options} options attribute.

Reynier Perez Mira schrieb:
> I have this PHP Code:
> $sql = $db->Execute("SELECT IDC, CNombre FROM os_catproductos ORDER BY IDC ASC");
> $arrCat = array();
> while ( $categorias = $sql->fetchRow() ) {
> $arrCat[] = $categorias;
> }
> $tpl->assign('catArr', $arrCat);
>
> Then I need to build an SELECT working with catArr values. I try this in template:
>
> <select id="arrCatSELECT" id="arrCatSELECT" size="1" onchange="javascript:document.location.href='index .php?cPath={$catArr.IDC}';">{html_options values={$catArr.IDC} output=$catArr.ANombre}</select>
>
> But it not works. Any ?
>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFD64cUtyx3EHt/UjARAhcYAJ9KpuUWlGrJkx+Ibkxulmnyg25tvwCdFz0K
Vbip5+HFzxSfQ8D1UuGOZ5I=
=lW62
-----END PGP SIGNATURE-----
  Réponse avec citation
Vieux 09/02/2006, 20h05   #2
Reynier Perez Mira
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut html_options is possible to do that ?

I have this PHP Code:
$sql = $db->Execute("SELECT IDC, CNombre FROM os_catproductos ORDER BY IDC ASC");
$arrCat = array();
while ( $categorias = $sql->fetchRow() ) {
$arrCat[] = $categorias;
}
$tpl->assign('catArr', $arrCat);

Then I need to build an SELECT working with catArr values. I try this in template:

<select id="arrCatSELECT" id="arrCatSELECT" size="1" onchange="javascript:document.location.href='index .php?cPath={$catArr.IDC}';">{html_options values={$catArr.IDC} output=$catArr.ANombre}</select>

But it not works. Any ?

--
ReynierPM
4to. Ing. Informática
Linux User: #310201
El programador superhéroe aprende de compartir sus conocimientos. Es el referente de sus compañeros. Todo el mundo va a preguntarle y él, secretamente, lo fomenta porque es así como adquiere su legendaria sabiduría: escuchando ayudando a los demás...
  Réponse avec citation
Vieux 09/02/2006, 20h26   #3
Monte Ohrt
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [SMARTY] html_options is possible to do that ?

syntax is:

{html_options values=$catArr.IDC output=$catArr.ANombre}

You cannot embed delimiters.



Reynier Perez Mira wrote:

>I have this PHP Code:
>$sql = $db->Execute("SELECT IDC, CNombre FROM os_catproductos ORDER BY IDC ASC");
>$arrCat = array();
>while ( $categorias = $sql->fetchRow() ) {
> $arrCat[] = $categorias;
>}
>$tpl->assign('catArr', $arrCat);
>
>Then I need to build an SELECT working with catArr values. I try this in template:
>
><select id="arrCatSELECT" id="arrCatSELECT" size="1" onchange="javascript:document.location.href='index .php?cPath={$catArr.IDC}';">{html_options values={$catArr.IDC} output=$catArr.ANombre}</select>
>
>But it not works. Any ?
>
>
>

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 20h16.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,08543 seconds with 11 queries