Files
smarty/docs/en/designers/language-builtin-functions/language-function-strip.xml
2004-04-14 15:53:39 +00:00

79 lines
2.1 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ -->
<sect1 id="language.function.strip">
<title>strip</title>
<para>
Many times web designers run into the issue where white space and
carriage returns affect the output of the rendered HTML (browser
"features"), so you must run all your tags together in the template
to get the desired results. This usually ends up in unreadable or
unmanageable templates.
</para>
<para>
Anything within {strip}{/strip} tags in Smarty are stripped of the
extra spaces or carriage returns at the beginnings and ends of the
lines before they are displayed. This way you can keep your
templates readable, and not worry about extra white space causing
problems.
</para>
<note>
<title>Technical Note</title>
<para>
{strip}{/strip} does not affect the contents of template variables.
See the <link linkend="language.modifier.strip">strip modifier
function</link>.
</para>
</note>
<example>
<title>strip tags</title>
<programlisting>
<![CDATA[
{* the following will be all run into one line upon output *}
{strip}
<table border=0>
<tr>
<td>
<A HREF="{$url}">
<font color="red">This is a test</font>
</A>
</td>
</tr>
</table>
{/strip}
OUTPUT:
<table border=0><tr><td><A HREF="http://my.domain.com"><font color="red">This is a test</font></A></td></tr></table>
]]>
</programlisting>
</example>
<para>
Notice that in the above example, all the lines begin and end
with HTML tags. Be aware that all the lines are run together.
If you have plain text at the beginning or end of any line,
they will be run together, and may not be desired results.
</para>
</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
-->