Files
smarty/docs/en/designers/language-modifiers/language-modifier-count-characters.xml

97 lines
2.2 KiB
XML
Raw Normal View History

2004-04-13 08:46:28 +00:00
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ -->
<sect1 id="language.modifier.count.characters">
<title>count_characters</title>
2005-09-13 17:53:50 +00:00
<para>
This is used to count the number of characters in a variable.
</para>
2004-04-13 08:46:28 +00:00
<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>Parameter Position</entry>
<entry>Type</entry>
<entry>Required</entry>
<entry>Default</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>1</entry>
<entry>boolean</entry>
<entry>No</entry>
2006-09-26 19:28:45 +00:00
<entry>&false;</entry>
2004-04-13 08:46:28 +00:00
<entry>This determines whether or not to include
whitespace characters in the count.</entry>
</row>
</tbody>
</tgroup>
</informaltable>
2005-09-13 17:53:50 +00:00
2004-04-13 08:46:28 +00:00
<example>
<title>count_characters</title>
<programlisting role="php">
<![CDATA[
<?php
$smarty->assign('articleTitle', 'Cold Wave Linked to Temperatures.');
?>
]]>
</programlisting>
<para>
Where template is:
2004-04-13 08:46:28 +00:00
</para>
<programlisting>
<![CDATA[
{$articleTitle}
{$articleTitle|count_characters}
{$articleTitle|count_characters:true}
]]>
</programlisting>
<para>
2006-09-26 19:28:45 +00:00
Will output:
2004-04-13 08:46:28 +00:00
</para>
<screen>
<![CDATA[
Cold Wave Linked to Temperatures.
29
33
]]>
</screen>
</example>
2005-05-21 12:41:15 +00:00
<para>
See also
2006-09-26 19:28:45 +00:00
<link linkend="language.modifier.count.words"><varname>count_words</varname></link>,
<link linkend="language.modifier.count.sentences"><varname>count_sentences</varname></link> and
<link linkend="language.modifier.count.paragraphs"><varname>count_paragraphs</varname></link>.
2005-05-21 12:41:15 +00:00
</para>
</sect1>
2004-04-13 08:46:28 +00:00
<!-- 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
2005-05-21 12:41:15 +00:00
-->