2
0

Zend_Mime_Part.xml 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <sect1 id="zend.mime.part">
  2. <title>Zend_Mime_Part</title>
  3. <sect2 id="zend.mime.part.introduction">
  4. <title>Введение</title>
  5. <para>
  6. Этот класс представляет отдельную часть сообщения MIME. он содержит
  7. фактическое содержимое части сообщения и информацию об его кодировке,
  8. типе содержимого и имени файла оригинала. Он предоставляет методы для
  9. генерации строки из сохраненных данных. Объекты <code>Zend_Mime_Part</code>
  10. могут быть добавлены в <link
  11. linkend="zend.mime.message"><code>Zend_Mime_Message</code></link>
  12. для компоновки целого сообщения с типом multipart.
  13. <!--
  14. This class represents a single part of a MIME message. It contains the
  15. actual content of the message part plus information about its encoding,
  16. content type and original filename. It provides a method for generating a
  17. string from the stored data. <code>Zend_Mime_Part</code> objects can be
  18. added to <link
  19. linkend="zend.mime.message"><code>Zend_Mime_Message</code></link> to
  20. assemble a complete multipart message.
  21. -->
  22. </para>
  23. </sect2>
  24. <sect2 id="zend.mime.part.instantiation">
  25. <title>Инстанцирование<!--Instantiation--></title>
  26. <para>
  27. Экземпляр класса <code>Zend_Mime_Part</code> создается с помощью строки,
  28. которая представляет собой содержимое новой части сообщения. Предполагается
  29. тип OCTET-STREAM, кодировка 8Bit. После инстанцирования
  30. <code>Zend_Mime_Part</code> метаданные могут быть установлены посредством
  31. прямого доступа к атрибутам:
  32. <!--
  33. <code>Zend_Mime_Part</code> is instantiated with a string that
  34. represents the content of the new part. The type is assumed to be
  35. OCTET-STREAM, encoding is 8Bit. After instantiating a
  36. <code>Zend_Mime_Part</code>, meta information can be set by accessing its
  37. attributes directly:
  38. -->
  39. </para>
  40. <programlisting language="php"><![CDATA[<?php
  41. public $type = ZMime::TYPE_OCTETSTREAM;
  42. public $encoding = ZMime::ENCODING_8BIT;
  43. public $id;
  44. public $disposition;
  45. public $filename;
  46. public $description;
  47. public $charset;
  48. ?>]]></programlisting>
  49. </sect2>
  50. <sect2 id="zend.mime.part.methods">
  51. <title>
  52. Методы для перевода части сообщения в строку
  53. <!--Methods for rendering the message part to a string-->
  54. </title>
  55. <para>
  56. <code>-&gt;getContent()</code> возвращает закодированное содержимое части
  57. сообщения MIME в виде строки с применением кодировки, указанной в атрибуте
  58. $encoding. Корректными значениями являются ZMime::ENCODING_*. Преобразование
  59. по таблице символов не производится.
  60. <!--
  61. <code>-&gt;getContent()</code> returns the encoded content of the
  62. MimePart as a string using the encoding specified in the attribute
  63. $encoding. Valid values are ZMime::ENCODING_* Characterset conversions are
  64. not performed.
  65. -->
  66. </para>
  67. <para>
  68. <code>-&gt;getHeaders()</code> возвращает заголовки MIME для части сообщения
  69. такими, какими они были сгенерированы из информации в открытых
  70. атрибутах. Нужно правильно установить атрибуты объекта, прежде чем
  71. будет вызван метод.
  72. <!--
  73. <code>-&gt;getHeaders()</code> returns the Mime-Headers for the
  74. MimePart as generated from the information in the publicly accessable
  75. attributes. The attributes of the object need to be set correctly before
  76. this method is called.
  77. -->
  78. <itemizedlist>
  79. <listitem>
  80. <para>
  81. <varname>$charset</varname>
  82. должен соответствовать текущему набору символов содержимого, если это
  83. содержимое имеет текстовый тип (простой текст или HTML).
  84. <!--
  85. has to be set to the actual charset of the content if it is a text type (Text or HTML).
  86. -->
  87. </para>
  88. </listitem>
  89. <listitem>
  90. <para>
  91. <varname>$id</varname>
  92. может быть установлен для идентификации содержимого для включенных
  93. изображений в сообщении HTML.
  94. <!--
  95. may be set to identify a content-id for inline images in a HTML mail.
  96. -->
  97. </para>
  98. </listitem>
  99. <listitem>
  100. <para>
  101. <varname>$filename</varname>
  102. содержит имя файла, которое будет получено при загрузке.
  103. <!--
  104. contains the name the file will get when downloading it.
  105. -->
  106. </para>
  107. </listitem>
  108. <listitem>
  109. <para>
  110. <varname>$disposition</varname>
  111. определяет, должен ли фал быть приложен в качестве вложения или
  112. использоваться внутри сообщения HTML.
  113. <!--
  114. defines if the file should be treated as an attachment or if it is used inside the (HTML-) mail (inline).
  115. -->
  116. </para>
  117. </listitem>
  118. <listitem>
  119. <para>
  120. <varname>$description</varname>
  121. используется только для информационных целей.
  122. <!--
  123. is only used for informational purposes.
  124. -->
  125. </para>
  126. </listitem>
  127. </itemizedlist></para>
  128. </sect2>
  129. </sect1>
  130. <!--
  131. vim:se ts=4 sw=4 et:
  132. -->