mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 02:44:27 +02:00
Added <![CDATA[ tags, <br> becomes <br />
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial -->
|
||||
<!-- EN-Revision: 1.1 Maintainer: gerald Status: ready -->
|
||||
<sect1 id="language.assigned.variables">
|
||||
<title>Variables assign<67>es depuis PHP</title>
|
||||
<para>
|
||||
@@ -67,7 +67,7 @@ $smarty->display('index.tpl');
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Cela va afficher :
|
||||
Ce qui donne en sortie :
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
@@ -88,31 +88,42 @@ zaphod@slartibartfast.com<br />
|
||||
</para>
|
||||
<example>
|
||||
<title>Acc<EFBFBD>s aux tableaux gr<67>ce <20> l'index</title>
|
||||
<programlisting>
|
||||
index.php:
|
||||
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('Contacts',
|
||||
$smarty->assign('Contacts',
|
||||
array('555-222-9876',
|
||||
'zaphod@slartibartfast.com',
|
||||
array('555-444-3333',
|
||||
'555-111-1234')));
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
index.tpl:
|
||||
|
||||
{$Contacts[0]}<br>
|
||||
{$Contacts[1]}<br>
|
||||
{* you can print arrays of arrays as well *}
|
||||
{$Contacts[2][0]}<br>
|
||||
{$Contacts[2][1]}<br>
|
||||
|
||||
SORTIE:
|
||||
|
||||
555-222-9876<br>
|
||||
zaphod@slartibartfast.com<br>
|
||||
555-444-3333<br>
|
||||
555-111-1234<br></programlisting>
|
||||
$smarty->display('index.tpl');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ou index.tpl est :
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$Contacts[0]}<br />
|
||||
{$Contacts[1]}<br />
|
||||
{* Vous pouvez <20>galement afficher des tableaux *}
|
||||
{$Contacts[2][0]}<br />
|
||||
{$Contacts[2][1]}<br />
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
ce qui donne en sortie :
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
555-222-9876<br />
|
||||
zaphod@slartibartfast.com<br />
|
||||
555-444-3333<br />
|
||||
555-111-1234<br />
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="language.variables.objects">
|
||||
@@ -124,13 +135,20 @@ zaphod@slartibartfast.com<br>
|
||||
<example>
|
||||
<title>acc<EFBFBD>der aux attributs des objets</title>
|
||||
<programlisting>
|
||||
nom: {$person->name}<br>
|
||||
email: {$person->email}<br>
|
||||
|
||||
SORTIE:
|
||||
|
||||
nom: Zaphod Beeblebrox<br>
|
||||
email: zaphod@slartibartfast.com<br></programlisting>
|
||||
<![CDATA[
|
||||
nom: {$person->name}<br />
|
||||
email: {$person->email}<br />
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ce qui donne en sortie :
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
nom: Zaphod Beeblebrox<br />
|
||||
email: zaphod@slartibartfast.com<br />
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
Reference in New Issue
Block a user