Files
smarty/docs/ru/designers/language-builtin-functions/language-function-strip.xml
2005-12-05 17:11:58 +00:00

80 lines
2.1 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="windows-1251"?>
<!-- $Revision$ -->
<!-- EN-Revision: 1.8 Maintainer: freespace Status: ready -->
<sect1 id="language.function.strip">
<title>{strip}</title>
<para>
Часто вебдизайнеры сталкиваются с проблемой, что пробелы и переносы
строк влияют на отображение HTML в броузере ("фишки" броузера), то
есть может понадобится склеить все теги в шаблоне вместе, чтобы получить
желаемый результат. Но в результате получается нечитаемый или
трудноредактируемый шаблон.
</para>
<para>
В выводимом тексте, заключенном между тэгами {strip} и {/strip},
удаляются повторные пробелы и переносы строк, перед отображением.
Так вы можете сохранив шаблон читаемым не волноваться насчет
лишних пробелов.
</para>
<note>
<title>Техническое Замечание</title>
<para>
{strip}{/strip} не влияет на содержимое переменных шаблона.
См. <link linkend="language.modifier.strip">модификатор strip</link>.
</para>
</note>
<example>
<title>тэги {strip}</title>
<programlisting>
<![CDATA[
{* следующее будет выведено в виде одной строки *}
{strip}
<table border='0'>
<tr>
<td>
<a href="{$url}">
<font color="red">This is a test</font>
</a>
</td>
</tr>
</table>
{/strip}
]]>
</programlisting>
<para>
Результат выполнения данного примера:
</para>
<screen>
<![CDATA[
<table border='0'><tr><td><a href="http://...snipped...</a></td></tr></table>
]]>
</screen>
</example>
<para>
Заметьте, что в данном примере все строки начинаются и заканчиваются HTML
тэгами. Учтите, что все строки склеиваются вместе. Если в начале или в
конце строки присутствует обычный текст, то вы можете не получить
желаемый результат.
</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
-->