Files
smarty/docs/ru/programmers/api-functions/api-append.xml
2008-01-22 21:04:44 +00:00

73 lines
2.6 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="UTF-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 1.5 Maintainer: freespace Status: ready -->
<refentry id="api.append">
<refnamediv>
<refname>append()</refname>
<refpurpose>добавляет элемент к назначенному массиву</refpurpose>
</refnamediv>
<refsect1>
<title>Описание</title>
<methodsynopsis>
<type>void</type><methodname>append</methodname>
<methodparam><type>mixed</type><parameter>var</parameter></methodparam>
</methodsynopsis>
<methodsynopsis>
<type>void</type><methodname>append</methodname>
<methodparam><type>string</type><parameter>varname</parameter></methodparam>
<methodparam><type>mixed</type><parameter>var</parameter></methodparam>
<methodparam choice="opt"><type>bool</type><parameter>merge</parameter></methodparam>
</methodsynopsis>
<para>
Если вы добавляете значение к строковому значению, последнее будет
предварительно преобразовано в массив. Вы можете явно передавать пары
ключей / значений, либо ассоциативный массив, содержащий пары
ключей / значений.
Если вы укажете необязательный третий аргумент, равный true, значение будет
совмещено с существующим массивом, вместо добавления.
</para>
&note.parameter.merge;
<example>
<title>append</title>
<programlisting role="php">
<![CDATA[
<?php
// передаем пары ключ / значение
$smarty->append("Name", "Fred");
$smarty->append("Address", $address);
// передаем ассоциативный массив
$smarty->append(array('city' => 'Lincoln', 'state' => 'Nebraska'));
?>
]]>
</programlisting>
</example>
<para>См. также
<link linkend="api.append.by.ref">append_by_ref()</link>,
<link linkend="api.assign">assign()</link>
и
<link linkend="api.get.template.vars">get_template_vars()</link>
</para>
</refsect1>
</refentry>
<!-- 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
-->