mirror of
				https://github.com/smarty-php/smarty.git
				synced 2025-11-03 22:01:36 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			150 lines
		
	
	
		
			4.3 KiB
		
	
	
	
		
			XML
		
	
	
	
	
	
			
		
		
	
	
			150 lines
		
	
	
		
			4.3 KiB
		
	
	
	
		
			XML
		
	
	
	
	
	
<?xml version="1.0" encoding="iso-8859-1"?>
 | 
						|
<!-- $Revision$ -->
 | 
						|
<!-- EN-Revision: 1.3 Maintainer: gerald Status: ready -->
 | 
						|
<sect1 id="language.function.html.radios">
 | 
						|
 <title>html_radios</title>
 | 
						|
 <informaltable frame="all">
 | 
						|
  <tgroup cols="5">
 | 
						|
   <colspec colname="param" align="center" />
 | 
						|
   <colspec colname="type" align="center" />
 | 
						|
   <colspec colname="required" align="center" />
 | 
						|
   <colspec colname="default" align="center" />
 | 
						|
   <colspec colname="desc" />
 | 
						|
   <thead>
 | 
						|
    <row>
 | 
						|
     <entry>Nom attribut</entry>
 | 
						|
     <entry>Type</entry>
 | 
						|
     <entry>Requis</entry>
 | 
						|
     <entry>Defaut</entry>
 | 
						|
     <entry>Description</entry>
 | 
						|
    </row>
 | 
						|
   </thead>
 | 
						|
   <tbody>
 | 
						|
    <row>
 | 
						|
     <entry>name</entry>
 | 
						|
     <entry>chaîne de caractères</entry>
 | 
						|
     <entry>Non</entry>
 | 
						|
     <entry><emphasis>radio</emphasis></entry>
 | 
						|
     <entry>nom de la liste boutons radio</entry>
 | 
						|
    </row>
 | 
						|
    <row>
 | 
						|
     <entry>values</entry>
 | 
						|
     <entry>tableau</entry>
 | 
						|
     <entry>Oui, à moins que vous n'utilisiez l'attribut
 | 
						|
     options</entry>
 | 
						|
     <entry><emphasis>n/a</emphasis></entry>
 | 
						|
     <entry>Le tableau des valeurs des boutons radio</entry>
 | 
						|
    </row>
 | 
						|
    <row>
 | 
						|
     <entry>output</entry>
 | 
						|
     <entry>tableau</entry>
 | 
						|
     <entry>Oui, à moins que vous n'utilisiez l'attribut
 | 
						|
     options</entry>
 | 
						|
     <entry><emphasis>n/a</emphasis></entry>
 | 
						|
     <entry>Un tableau de libellés pour les boutons radio</entry>
 | 
						|
    </row>
 | 
						|
    <row>
 | 
						|
     <entry>checked</entry>
 | 
						|
     <entry>chaîne de caractères</entry>
 | 
						|
     <entry>Non</entry>
 | 
						|
     <entry><emphasis>empty</emphasis></entry>
 | 
						|
     <entry>Les boutons radios sélectionnés</entry>
 | 
						|
    </row>
 | 
						|
    <row>
 | 
						|
     <entry>options</entry>
 | 
						|
     <entry>tableau associatif</entry>
 | 
						|
     <entry>Oui, à moins que vous n'utilisiez values
 | 
						|
     et outputs</entry>
 | 
						|
     <entry><emphasis>n/a</emphasis></entry>
 | 
						|
     <entry>un tableau associatif valeurs / libellés</entry>
 | 
						|
    </row>
 | 
						|
    <row>
 | 
						|
     <entry>separator</entry>
 | 
						|
     <entry>chaîne de caractères</entry>
 | 
						|
     <entry>Non</entry>
 | 
						|
     <entry><emphasis>empty</emphasis></entry>
 | 
						|
     <entry>chaîne de séparation à placer entre les
 | 
						|
     boutons radio</entry>
 | 
						|
    </row>
 | 
						|
   </tbody>
 | 
						|
  </tgroup>
 | 
						|
 </informaltable>
 | 
						|
 <para>
 | 
						|
  html_radio est une fonction utilisateur qui crée des boutons radio
 | 
						|
  html à partir des données fournies. Elle prend en charge les éléments
 | 
						|
  sélectionnés par défaut. Les attributs requis sont values et output,
 | 
						|
  à moins que vous n'utilisiez options à la place. La sortie générée est
 | 
						|
  compatible XHTML.
 | 
						|
 </para>
 | 
						|
 <para>
 | 
						|
  Tous les paramètres qui ne sont pas dans la liste ci dessus sont
 | 
						|
  affichés en tant que paires nom / valeur dans chaque balise <input>
 | 
						|
  créée.
 | 
						|
 </para>
 | 
						|
 
 | 
						|
 <example>
 | 
						|
  <title>html_radios</title>
 | 
						|
  <programlisting>
 | 
						|
index.php:
 | 
						|
 | 
						|
require('Smarty.class.php');
 | 
						|
$smarty = new Smarty;
 | 
						|
$smarty->assign('id_client', array(1000,1001,1002,1003));
 | 
						|
$smarty->assign('nom_client', array('Joe Schmoe','Jack Smith','Jane
 | 
						|
Johnson','Charlie Brown'));
 | 
						|
$smarty->assign('client_id', 1001);
 | 
						|
$smarty->display('index.tpl');
 | 
						|
 | 
						|
 | 
						|
index.tpl:
 | 
						|
 | 
						|
{html_radios name="id" values=$id_client checked=$client_id output=$nom_client separator="<br />"}
 | 
						|
 | 
						|
 | 
						|
index.php:
 | 
						|
 | 
						|
require('Smarty.class.php');
 | 
						|
$smarty = new Smarty;
 | 
						|
$smarty->assign('cust_radios', array(
 | 
						|
			1000 => 'Joe Schmoe',
 | 
						|
			1001 => 'Jack Smith',
 | 
						|
			1002 => 'Jane Johnson',
 | 
						|
			1003 => 'Charlie Brown'));
 | 
						|
$smarty->assign('client_id', 1001);
 | 
						|
$smarty->display('index.tpl');
 | 
						|
 | 
						|
 | 
						|
index.tpl:
 | 
						|
 | 
						|
{html_radios name="id" options=$cust_radios checked=$client_id separator="<br />"}
 | 
						|
 | 
						|
 | 
						|
SORTIE: (pour les deux exemples)
 | 
						|
 | 
						|
<input type="radio" name="id" value="1000">Joe Schmoe<br />
 | 
						|
<input type="radio" name="id" value="1001" checked="checked"><br />
 | 
						|
<input type="radio" name="id" value="1002">Jane Johnson<br />
 | 
						|
<input type="radio" name="id" value="1003">Charlie Brown<br /></programlisting>
 | 
						|
 </example>
 | 
						|
</sect1>
 | 
						|
<!-- Keep this comment at the end of the file
 | 
						|
Local variables:
 | 
						|
mode: sgml
 | 
						|
sgml-omittag:t
 | 
						|
sgml-shorttag:t
 | 
						|
sgml-minimize-attributes:nil
 | 
						|
sgml-always-quote-attributes:t
 | 
						|
sgml-indent-step:1
 | 
						|
sgml-indent-data:t
 | 
						|
indent-tabs-mode:nil
 | 
						|
sgml-parent-document:nil
 | 
						|
sgml-default-dtd-file:"../../../../manual.ced"
 | 
						|
sgml-exposed-tags:nil
 | 
						|
sgml-local-catalogs:nil
 | 
						|
sgml-local-ecat-files:nil
 | 
						|
End:
 | 
						|
vim600: syn=xml fen fdm=syntax fdl=2 si
 | 
						|
vim: et tw=78 syn=sgml
 | 
						|
vi: ts=1 sw=1
 | 
						|
-->
 |