An abstract base MIME Header.
Methods
Creates a new Header.
__construct(\Swift_Mime_Grammar $grammar)
Returns a string representation of this object.
__toString() : string
Get the character set used in this Header.
getCharset() : string
Get the field body, prepared for folding into a final header value.
getFieldBody() : string
Inherited
inherited_from |
\Swift_Mime_Header::getFieldBody() |
Returns
string
Get the model for the field body.
getFieldBodyModel() : mixed
Inherited
The return type depends on the specifics of the Header.
inherited_from |
\Swift_Mime_Header::getFieldBodyModel() |
Returns
mixed
Get the name of this header (e.g.
getFieldName() : string
Get the type of Header that this instance represents.
getFieldType() : int
Inherited
Get the language used in this Header.
getLanguage() : string
Get the maximum permitted length of lines in this Header.
getMaxLineLength() : int
Set the character set used in this Header.
setCharset(string $charset)
Parameters
$charset
string
Set the encoder used for encoding the header.
setEncoder(\Swift_Mime_HeaderEncoder $encoder)
Set the model for the field body.
setFieldBodyModel(mixed $model)
Inherited
The actual types needed will vary depending upon the type of Header.
inherited_from |
\Swift_Mime_Header::setFieldBodyModel() |
Parameters
$model
mixed
Set the grammar used for the header.
setGrammar(\Swift_Mime_Grammar $grammar)
Set the language used in this Header.
setLanguage(string $lang)
For example, for US English, 'en-us'.
This can be unspecified.
Parameters
$lang
string
Set the maximum length of lines in the header (excluding EOL).
setMaxLineLength(int $lineLength)
Parameters
$lineLength
int
Get this Header rendered as a RFC 2822 compliant string.
toString() : string
Exceptions
Returns
string
Clear the cached value if $condition is met.
clearCachedValueIf(boolean $condition)
Parameters
$condition
boolean
Produces a compliant, formatted RFC 2822 'phrase' based on the string given.
createPhrase(\Swift_Mime_Header $header, string $string, string $charset, \Swift_Mime_HeaderEncoder $encoder, boolean $shorten) : string
Parameters
$string
string
as displayed
$charset
string
of the text
$shorten
boolean
the first line to make remove for header name
Returns
string
Encode needed word tokens within a string of input.
encodeWords(\Swift_Mime_Header $header, string $input, $usedLength) : string
Parameters
$header
$input
string
$usedLength
Returns
string
Generates tokens from the given string which include CRLF as individual tokens.
generateTokenLines(string $token) : string[]
Parameters
$token
string
Returns
string[]
Get the value in the cache.
getCachedValue() : string
Splits a string into tokens in blocks of words which can be encoded quickly.
getEncodableWordTokens(string $string) : string[]
Parameters
$string
string
Returns
string[]
Get a token as an encoded word for safe insertion into headers.
getTokenAsEncodedWord(string $token, $firstLineOffset) : string
Parameters
$firstLineOffset
Returns
string
Set a value into the cache.
setCachedValue(string $value)
Set the name of this Header field.
setFieldName(string $name)
Generate a list of all tokens in the final header.
toTokens(string $string) : array
Parameters
$string
string
The string to tokenize
Returns
array
An array of tokens as strings
Test if a token needs to be encoded or not.
tokenNeedsEncoding(string $token) : boolean
Parameters
$token
string
Returns
boolean
Takes an array of tokens which appear in the header and turns them into
an RFC 2822 compliant string, adding FWSP where needed.
_tokensToString(array $tokens) : string
Parameters
$tokens
string[]
Returns
string
Properties
Constants
Date and time headers
TYPE_DATE
Inherited
inherited_from |
\Swift_Mime_Header::TYPE_DATE |
Identification headers
TYPE_ID
Inherited
inherited_from |
\Swift_Mime_Header::TYPE_ID |
Mailbox and address headers
TYPE_MAILBOX
Inherited
inherited_from |
\Swift_Mime_Header::TYPE_MAILBOX |
Parameterized headers (text + params)
TYPE_PARAMETERIZED
Inherited
inherited_from |
\Swift_Mime_Header::TYPE_PARAMETERIZED |
Address path headers
TYPE_PATH
Inherited
inherited_from |
\Swift_Mime_Header::TYPE_PATH |
Text headers
TYPE_TEXT
Inherited
inherited_from |
\Swift_Mime_Header::TYPE_TEXT |