mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 19:04:27 +02:00
sync with en
This commit is contained in:
@@ -1,110 +1,116 @@
|
|||||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||||
<!-- $Revision$ -->
|
<!-- $Revision$ -->
|
||||||
<!-- EN-Revision: 1.2 Maintainer: andreas Status: ready -->
|
<!-- EN-Revision: 1.11 Maintainer: andreas Status: ready -->
|
||||||
<sect1 id="language.function.html.checkboxes">
|
<sect1 id="language.function.html.checkboxes">
|
||||||
<title>html_checkboxes (Ausgabe von HTML-CHECKBOX Tag)</title>
|
<title>{html_checkboxes} (Ausgabe von HTML-Checkbox Tag)</title>
|
||||||
<informaltable frame="all">
|
<informaltable frame="all">
|
||||||
<tgroup cols="5">
|
<tgroup cols="5">
|
||||||
<colspec colname="param" align="center" />
|
<colspec colname="param" align="center" />
|
||||||
<colspec colname="type" align="center" />
|
<colspec colname="type" align="center" />
|
||||||
<colspec colname="required" align="center" />
|
<colspec colname="required" align="center" />
|
||||||
<colspec colname="default" align="center" />
|
<colspec colname="default" align="center" />
|
||||||
<colspec colname="desc" />
|
<colspec colname="desc" />
|
||||||
<thead>
|
<thead>
|
||||||
<row>
|
<row>
|
||||||
<entry>Attribut Name</entry>
|
<entry>Attribut Name</entry>
|
||||||
<entry>Typ</entry>
|
<entry>Typ</entry>
|
||||||
<entry>Erforderlich</entry>
|
<entry>Erforderlich</entry>
|
||||||
<entry>Standardwert</entry>
|
<entry>Standardwert</entry>
|
||||||
<entry>Beschreibung</entry>
|
<entry>Beschreibung</entry>
|
||||||
</row>
|
</row>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<row>
|
<row>
|
||||||
<entry>name</entry>
|
<entry>name</entry>
|
||||||
<entry>string</entry>
|
<entry>string</entry>
|
||||||
<entry>Nein</entry>
|
<entry>Nein</entry>
|
||||||
<entry><emphasis>checkbox</emphasis></entry>
|
<entry><emphasis>checkbox</emphasis></entry>
|
||||||
<entry>Name der checkbox Liste</entry>
|
<entry>Name der checkbox Liste</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry>values</entry>
|
<entry>values</entry>
|
||||||
<entry>array</entry>
|
<entry>array</entry>
|
||||||
<entry>ja, ausser wenn das option Attribut verwendet wird</entry>
|
<entry>ja, ausser wenn das option Attribut verwendet wird</entry>
|
||||||
<entry><emphasis>n/a</emphasis></entry>
|
<entry><emphasis>n/a</emphasis></entry>
|
||||||
<entry>ein Array mit Werten für die checkboxes</entry>
|
<entry>ein Array mit Werten f<EFBFBD>r die checkboxes</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry>output</entry>
|
<entry>output</entry>
|
||||||
<entry>array</entry>
|
<entry>array</entry>
|
||||||
<entry>ja, ausser wenn das option Attribut verwendet wird</entry>
|
<entry>ja, ausser wenn das option Attribut verwendet wird</entry>
|
||||||
<entry><emphasis>n/a</emphasis></entry>
|
<entry><emphasis>n/a</emphasis></entry>
|
||||||
<entry>ein Array mit Werten für checkbox Knöpfe</entry>
|
<entry>ein Array mit Werten f<EFBFBD>r checkbox Kn<EFBFBD>pfe</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry>selected</entry>
|
<entry>selected</entry>
|
||||||
<entry>string/array</entry>
|
<entry>string/array</entry>
|
||||||
<entry>No</entry>
|
<entry>No</entry>
|
||||||
<entry><emphasis>empty</emphasis></entry>
|
<entry><emphasis>empty</emphasis></entry>
|
||||||
<entry>das/die ausgewählten checkbox Elemente</entry>
|
<entry>das/die ausgew<EFBFBD>hlten checkbox Elemente</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry>options</entry>
|
<entry>options</entry>
|
||||||
<entry>assoziatives array</entry>
|
<entry>assoziatives array</entry>
|
||||||
<entry>Ja, ausser values/output wird verwendet</entry>
|
<entry>Ja, ausser values/output wird verwendet</entry>
|
||||||
<entry><emphasis>n/a</emphasis></entry>
|
<entry><emphasis>n/a</emphasis></entry>
|
||||||
<entry>ein assoziatives Array mit Werten und Ausgaben</entry>
|
<entry>ein assoziatives Array mit Werten und Ausgaben</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry>separator</entry>
|
<entry>separator</entry>
|
||||||
<entry>string</entry>
|
<entry>string</entry>
|
||||||
<entry>No</entry>
|
<entry>No</entry>
|
||||||
<entry><emphasis>empty</emphasis></entry>
|
<entry><emphasis>empty</emphasis></entry>
|
||||||
<entry>Zeichenkette die zwischen den checkbox Elementen eingefügt werden soll</entry>
|
<entry>Zeichenkette die zwischen den checkbox Elementen eingef<EFBFBD>gt werden soll</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry>labels</entry>
|
<entry>labels</entry>
|
||||||
<entry>boolean</entry>
|
<entry>boolean</entry>
|
||||||
<entry>No</entry>
|
<entry>No</entry>
|
||||||
<entry><emphasis>true</emphasis></entry>
|
<entry><emphasis>true</emphasis></entry>
|
||||||
<entry>fügt der Ausgabe <label>-Tags hinzu</entry>
|
<entry>f<EFBFBD>gt der Ausgabe <label>-Tags hinzu</entry>
|
||||||
</row>
|
</row>
|
||||||
</tbody>
|
</tbody>
|
||||||
</tgroup>
|
</tgroup>
|
||||||
</informaltable>
|
</informaltable>
|
||||||
<para>
|
<para>
|
||||||
html_checkboxes ist eine Funktion die aus den übergebenen Daten html checkbox
|
html_checkboxes ist eine <link
|
||||||
Elemente erstellt und kümmert sich darum welche Elemente ausgewählt sind.
|
linkend="language.custom.functions">Funktion</link> die aus den
|
||||||
Erforderliche Attribute sind Wert/Ausgabe oder Options. Die Ausgabe ist XHTML kompatibel
|
<EFBFBD>bergebenen Daten html checkbox Elemente erstellt und k<>mmert sich
|
||||||
</para>
|
darum welche Elemente ausgew<65>hlt sind. Erforderliche Attribute sind
|
||||||
<para>
|
Wert/Ausgabe oder Options. Die Ausgabe ist XHTML kompatibel
|
||||||
Alle Parameter die nicht in der Liste erwähnt werden, werden ausgegeben.
|
</para>
|
||||||
</para>
|
<para>
|
||||||
<example>
|
Alle Parameter die nicht in der Liste erw<72>hnt werden, werden ausgegeben.
|
||||||
<title>html_checkboxes</title>
|
</para>
|
||||||
<programlisting>
|
<example>
|
||||||
|
<title>{html_checkboxes}</title>
|
||||||
|
<programlisting role="php">
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
require('Smarty.class.php');
|
require('Smarty.class.php');
|
||||||
$smarty = new Smarty;
|
$smarty = new Smarty;
|
||||||
$smarty->assign('cust_ids', array(1000,1001,1002,1003));
|
$smarty->assign('cust_ids', array(1000,1001,1002,1003));
|
||||||
$smarty->assign('cust_names', array('Joe Schmoe','Jack Smith','Jane Johnson','Charlie Brown'));
|
$smarty->assign('cust_names', array('Joe Schmoe',
|
||||||
|
'Jack Smith',
|
||||||
|
'Jane Johnson',
|
||||||
|
'Charlie Brown'));
|
||||||
$smarty->assign('customer_id', 1001);
|
$smarty->assign('customer_id', 1001);
|
||||||
$smarty->display('index.tpl');
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
]]
|
]]>
|
||||||
</programlisting>
|
</programlisting>
|
||||||
<para>
|
<para>
|
||||||
where index.tpl is:
|
Wobei index.tpl wie folgt aussieht:
|
||||||
</para>
|
</para>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
{html_checkboxes name="id" values=$cust_ids selected=$customer_id output=$cust_names separator=
|
{html_checkboxes name="id" values=$cust_ids selected=$customer_id output=$cust_names separator="<br />"}
|
||||||
"<br />"}
|
]]>
|
||||||
]]
|
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
<para>
|
||||||
|
Oder mit folgendem PHP-Code:
|
||||||
|
</para>
|
||||||
<programlisting role="php">
|
<programlisting role="php">
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
<?php
|
<?php
|
||||||
@@ -126,8 +132,7 @@ $smarty->display('index.tpl');
|
|||||||
</para>
|
</para>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
{html_checkboxes name="id" options=$cust_checkboxes selected=$customer_id separator="<br /&g
|
{html_checkboxes name="id" options=$cust_checkboxes selected=$customer_id separator="<br />"}
|
||||||
t;"}
|
|
||||||
]]>
|
]]>
|
||||||
</programlisting>
|
</programlisting>
|
||||||
<para>
|
<para>
|
||||||
@@ -136,8 +141,7 @@ t;"}
|
|||||||
<screen>
|
<screen>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
<label><input type="checkbox" name="id[]" value="1000" />Joe Schmoe</label><br />
|
<label><input type="checkbox" name="id[]" value="1000" />Joe Schmoe</label><br />
|
||||||
<label><input type="checkbox" name="id[]" value="1001" checked="checked" />Jack Smith</label><b
|
<label><input type="checkbox" name="id[]" value="1001" checked="checked" />Jack Smith</label><br />
|
||||||
r />
|
|
||||||
<label><input type="checkbox" name="id[]" value="1002" />Jane Johnson</label><br />
|
<label><input type="checkbox" name="id[]" value="1002" />Jane Johnson</label><br />
|
||||||
<label><input type="checkbox" name="id[]" value="1003" />Charlie Brown</label><br />
|
<label><input type="checkbox" name="id[]" value="1003" />Charlie Brown</label><br />
|
||||||
]]>
|
]]>
|
||||||
|
Reference in New Issue
Block a user