mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 02:44:27 +02:00
Added <![CDATA[ tags, Sync translations infos, added missing param in count-characters
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||||
<!-- $Revision$ -->
|
<!-- $Revision$ -->
|
||||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial -->
|
<!-- EN-Revision: 1.1 Maintainer: gerald Status: ready -->
|
||||||
<sect1 id="language.modifier.capitalize">
|
<sect1 id="language.modifier.capitalize">
|
||||||
<title>capitalize</title>
|
<title>capitalize</title>
|
||||||
<para>
|
<para>
|
||||||
@@ -8,22 +8,32 @@
|
|||||||
</para>
|
</para>
|
||||||
<example>
|
<example>
|
||||||
<title>capitalize</title>
|
<title>capitalize</title>
|
||||||
<programlisting>
|
<programlisting role="php">
|
||||||
index.php:
|
<![CDATA[
|
||||||
|
<?php
|
||||||
|
|
||||||
$smarty = new Smarty;
|
$smarty = new Smarty;
|
||||||
$smarty->assign('titreArticle', 'La police commence une campagne de sensibilisation contre la violence routi<74>re.');
|
$smarty->assign('articleTitle', 'Police begin campaign to rundown jaywalkers.');
|
||||||
$smarty->display('index.tpl');
|
$smarty->display('index.tpl');
|
||||||
|
|
||||||
index.tpl:
|
|
||||||
|
|
||||||
{$titreArticle}
|
|
||||||
{$titreArticle|capitalize}
|
|
||||||
|
|
||||||
SORTIE:
|
|
||||||
|
|
||||||
|
?>
|
||||||
|
]]>
|
||||||
|
</programlisting>
|
||||||
|
<para>
|
||||||
|
Where index.tpl is:
|
||||||
|
</para>
|
||||||
|
<programlisting>
|
||||||
|
<![CDATA[
|
||||||
|
{$articleTitle}
|
||||||
|
{$articleTitle|capitalize}
|
||||||
|
]]>
|
||||||
|
</programlisting>
|
||||||
|
<screen>
|
||||||
|
<![CDATA[
|
||||||
La police commence une campagne de sensibilisation contre la violence routi<74>re.
|
La police commence une campagne de sensibilisation contre la violence routi<74>re.
|
||||||
La Police Commence Une Campagne De Sensibilisation Contre La Violence Routi<74>re.</programlisting>
|
La Police Commence Une Campagne De Sensibilisation Contre La Violence Routi<74>re.
|
||||||
|
]]>
|
||||||
|
</screen>
|
||||||
</example>
|
</example>
|
||||||
</sect1>
|
</sect1>
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||||
<!-- $Revision$ -->
|
<!-- $Revision$ -->
|
||||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial -->
|
<!-- EN-Revision: 1.1 Maintainer: gerald Status: ready -->
|
||||||
<sect1 id="language.modifier.cat">
|
<sect1 id="language.modifier.cat">
|
||||||
<title>cat</title>
|
<title>cat</title>
|
||||||
<informaltable frame="all">
|
<informaltable frame="all">
|
||||||
@@ -35,20 +35,31 @@
|
|||||||
</para>
|
</para>
|
||||||
<example>
|
<example>
|
||||||
<title>cat</title>
|
<title>cat</title>
|
||||||
<programlisting>
|
<programlisting role="php">
|
||||||
index.php:
|
<![CDATA[
|
||||||
|
<?php
|
||||||
$smarty = new Smarty;
|
$smarty = new Smarty;
|
||||||
$smarty->assign('TitreArticle', 'Les devins ont pr<70>vus que le monde existera toujours ');
|
$smarty->assign('articleTitle', "'Les devins ont pr<70>vus que le monde existera toujours");
|
||||||
$smarty->display('index.tpl');
|
$smarty->display('index.tpl');
|
||||||
|
?>
|
||||||
index.tpl:
|
]]>
|
||||||
|
</programlisting>
|
||||||
{$TitreArticle|cat:" demain."}
|
<para>
|
||||||
|
Ou index.tpl est:
|
||||||
SORTIE:
|
</para>
|
||||||
|
<programlisting>
|
||||||
Les devins ont pr<70>vus que le monde existera toujours demain.</programlisting>
|
<![CDATA[
|
||||||
|
{$articleTitle|cat:" demain."}
|
||||||
|
]]>
|
||||||
|
</programlisting>
|
||||||
|
<para>
|
||||||
|
Donne <20> l'<27>cran:
|
||||||
|
</para>
|
||||||
|
<screen>
|
||||||
|
<![CDATA[
|
||||||
|
Les devins ont pr<70>vus que le monde existera toujours demain.
|
||||||
|
]]>
|
||||||
|
</screen>
|
||||||
</example>
|
</example>
|
||||||
</sect1>
|
</sect1>
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
|
@@ -1,30 +1,71 @@
|
|||||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||||
<!-- $Revision$ -->
|
<!-- $Revision$ -->
|
||||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial -->
|
<!-- EN-Revision: 1.1 Maintainer: gerald Status: ready -->
|
||||||
<sect1 id="language.modifier.count.characters">
|
<sect1 id="language.modifier.count.characters">
|
||||||
<title>count_characters</title>
|
<title>count_characters</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>Position du param<61>tre</entry>
|
||||||
|
<entry>Type</entry>
|
||||||
|
<entry>Requis</entry>
|
||||||
|
<entry>Defaut</entry>
|
||||||
|
<entry>Description</entry>
|
||||||
|
</row>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<row>
|
||||||
|
<entry>1</entry>
|
||||||
|
<entry>boolean</entry>
|
||||||
|
<entry>Non</entry>
|
||||||
|
<entry>false</entry>
|
||||||
|
<entry>Si l'on doit inclure les espaces dans le compte.</entry>
|
||||||
|
</row>
|
||||||
|
</tbody>
|
||||||
|
</tgroup>
|
||||||
|
</informaltable>
|
||||||
<para>
|
<para>
|
||||||
Compte le nombre de caract<63>res dans une variable.
|
Compte le nombre de caract<63>res dans une variable.
|
||||||
</para>
|
</para>
|
||||||
<example>
|
<example>
|
||||||
<title>count_characters</title>
|
<title>count_characters</title>
|
||||||
<programlisting>
|
<programlisting role="php">
|
||||||
index.php:
|
<![CDATA[
|
||||||
|
<?php
|
||||||
|
|
||||||
$smarty = new Smarty;
|
$smarty = new Smarty;
|
||||||
$smarty->assign('titreArticle', 'Vagues de froid li<6C>es <20> la temp<6D>rature.');
|
$smarty->assign('titreArticle', 'Vagues de froid li<6C>es <20> la temp<6D>rature.');
|
||||||
$smarty->display('index.tpl');
|
$smarty->display('index.tpl');
|
||||||
|
|
||||||
index.tpl:
|
|
||||||
|
|
||||||
|
?>
|
||||||
|
]]>
|
||||||
|
</programlisting>
|
||||||
|
<para>
|
||||||
|
Ou index.tpl est:
|
||||||
|
</para>
|
||||||
|
<programlisting>
|
||||||
|
<![CDATA[
|
||||||
{$titreArticle}
|
{$titreArticle}
|
||||||
{$titreArticle|count_characters}
|
{$titreArticle|count_characters}
|
||||||
|
{$titreArticle|count_characters:true}
|
||||||
SORTIE:
|
]]>
|
||||||
|
|
||||||
Vagues de froid li<6C>es <20> la temp<6D>rature.
|
|
||||||
39
|
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
<para>
|
||||||
|
Ce qui donne en sortie :
|
||||||
|
</para>
|
||||||
|
<screen>
|
||||||
|
<![CDATA[
|
||||||
|
Vagues de froid li<6C>es <20> la temp<6D>rature.
|
||||||
|
33
|
||||||
|
39
|
||||||
|
]]>
|
||||||
|
</screen>
|
||||||
</example>
|
</example>
|
||||||
</sect1>
|
</sect1>
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||||
<!-- $Revision$ -->
|
<!-- $Revision$ -->
|
||||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial -->
|
<!-- EN-Revision: 1.1 Maintainer: gerald Status: ready -->
|
||||||
<sect1 id="language.modifier.count.paragraphs">
|
<sect1 id="language.modifier.count.paragraphs">
|
||||||
<title>count_paragraphs</title>
|
<title>count_paragraphs</title>
|
||||||
<para>
|
<para>
|
||||||
@@ -8,22 +8,30 @@
|
|||||||
</para>
|
</para>
|
||||||
<example>
|
<example>
|
||||||
<title>count_paragraphs</title>
|
<title>count_paragraphs</title>
|
||||||
<programlisting>
|
<programlisting role="php">
|
||||||
index.php:
|
<![CDATA[
|
||||||
|
<?php
|
||||||
$smarty = new Smarty;
|
$smarty = new Smarty;
|
||||||
$smarty->assign('TitreArticle', 'La guerre apporte la paix, au prix de la vie de certains innocents.');
|
$smarty->assign('TitreArticle', 'La guerre apporte la paix, au prix de la vie de certains innocents.');
|
||||||
$smarty->display('index.tpl');
|
$smarty->display('index.tpl');
|
||||||
|
?>
|
||||||
index.tpl:
|
]]>
|
||||||
|
</programlisting>
|
||||||
|
<para>
|
||||||
|
Ou index.tpl est:
|
||||||
|
</para>
|
||||||
|
<programlisting>
|
||||||
|
<![CDATA[
|
||||||
{$TitreArticle}
|
{$TitreArticle}
|
||||||
{$TitreArticle|count_paragraphs}
|
{$TitreArticle|count_paragraphs}
|
||||||
|
]]>
|
||||||
SORTIE:
|
</programlisting>
|
||||||
|
<screen>
|
||||||
|
<![CDATA[
|
||||||
La guerre apporte la paix, au prix de la vie des innocents.
|
La guerre apporte la paix, au prix de la vie des innocents.
|
||||||
1</programlisting>
|
1
|
||||||
|
]]>
|
||||||
|
</screen>
|
||||||
</example>
|
</example>
|
||||||
</sect1>
|
</sect1>
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||||
<!-- $Revision$ -->
|
<!-- $Revision$ -->
|
||||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial -->
|
<!-- EN-Revision: 1.1 Maintainer: gerald Status: ready -->
|
||||||
<sect1 id="language.modifier.count.sentences">
|
<sect1 id="language.modifier.count.sentences">
|
||||||
<title>count_sentences</title>
|
<title>count_sentences</title>
|
||||||
<para>
|
<para>
|
||||||
@@ -8,26 +8,38 @@
|
|||||||
</para>
|
</para>
|
||||||
<example>
|
<example>
|
||||||
<title>count_sentences</title>
|
<title>count_sentences</title>
|
||||||
<programlisting>
|
<programlisting role="php">
|
||||||
index.php:
|
<![CDATA[
|
||||||
|
<?php
|
||||||
$smarty = new Smarty;
|
$smarty = new Smarty;
|
||||||
$smarty->assign('TitreArticle', 'Deux navires rentrent en
|
$smarty->assign('TitreArticle', 'Deux navires rentrent en
|
||||||
collision - Un des deux coule. Des vaches enrag<61>es blessent un fermier <20>
|
collision - Un des deux coule. Des vaches enrag<61>es blessent un fermier <20>
|
||||||
coups de haches.');
|
coups de haches.');
|
||||||
$smarty->display('index.tpl');
|
$smarty->display('index.tpl');
|
||||||
|
?>
|
||||||
index.tpl:
|
]]>
|
||||||
|
</programlisting>
|
||||||
|
<para>
|
||||||
|
Where index.tpl is:
|
||||||
|
</para>
|
||||||
|
<programlisting>
|
||||||
|
<![CDATA[
|
||||||
{$TitreArticle}
|
{$TitreArticle}
|
||||||
{$TitreArticle|count_sentences}
|
{$TitreArticle|count_sentences}
|
||||||
|
]]>
|
||||||
SORTIE:
|
</programlisting>
|
||||||
|
<para>
|
||||||
|
Donne <20> l'<27>cran:
|
||||||
|
</para>
|
||||||
|
<screen>
|
||||||
|
<![CDATA[
|
||||||
Deux navires rentrent en collision
|
Deux navires rentrent en collision
|
||||||
- Un des deux coule. Des vaches enrag<61>es blessent un fermier
|
- Un des deux coule. Des vaches enrag<61>es blessent un fermier
|
||||||
<EFBFBD> coups de haches.
|
<EFBFBD> coups de haches.
|
||||||
|
|
||||||
2</programlisting>
|
2
|
||||||
|
]]>
|
||||||
|
</screen>
|
||||||
</example>
|
</example>
|
||||||
</sect1>
|
</sect1>
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||||
<!-- $Revision$ -->
|
<!-- $Revision$ -->
|
||||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial -->
|
<!-- EN-Revision: 1.1 Maintainer: gerald Status: ready -->
|
||||||
<sect1 id="language.modifier.count.words">
|
<sect1 id="language.modifier.count.words">
|
||||||
<title>count_words</title>
|
<title>count_words</title>
|
||||||
<para>
|
<para>
|
||||||
@@ -8,22 +8,35 @@
|
|||||||
</para>
|
</para>
|
||||||
<example>
|
<example>
|
||||||
<title>count_words</title>
|
<title>count_words</title>
|
||||||
<programlisting>
|
<programlisting role="php">
|
||||||
index.php:
|
<![CDATA[
|
||||||
|
<?php
|
||||||
|
|
||||||
$smarty = new Smarty;
|
$smarty = new Smarty;
|
||||||
$smarty->assign('TitreArticle', 'Un anneau pour les gouverner tous.');
|
$smarty->assign('TitreArticle', 'Un anneau pour les gouverner tous.');
|
||||||
$smarty->display('index.tpl');
|
$smarty->display('index.tpl');
|
||||||
|
|
||||||
index.tpl:
|
|
||||||
|
|
||||||
|
?>
|
||||||
|
]]>
|
||||||
|
</programlisting>
|
||||||
|
<para>
|
||||||
|
Ou index.tpl est:
|
||||||
|
</para>
|
||||||
|
<programlisting>
|
||||||
|
<![CDATA[
|
||||||
{$titreArticle}
|
{$titreArticle}
|
||||||
{$titreArticle|count_words}
|
{$titreArticle|count_words}
|
||||||
|
]]>
|
||||||
SORTIE:
|
</programlisting>
|
||||||
|
<para>
|
||||||
|
Donne <20> l'<27>cran:
|
||||||
|
</para>
|
||||||
|
<screen>
|
||||||
|
<![CDATA[
|
||||||
Un anneau pour les gouverner tous.
|
Un anneau pour les gouverner tous.
|
||||||
6</programlisting>
|
6
|
||||||
|
]]>
|
||||||
|
</screen>
|
||||||
</example>
|
</example>
|
||||||
</sect1>
|
</sect1>
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
|
Reference in New Issue
Block a user