本文整理匯總了PHP中Swift_Mime_Headers_AbstractHeader類的典型用法代碼示例。如果您正苦於以下問題:PHP Swift_Mime_Headers_AbstractHeader類的具體用法?PHP Swift_Mime_Headers_AbstractHeader怎麽用?PHP Swift_Mime_Headers_AbstractHeader使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Swift_Mime_Headers_AbstractHeader類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
/**
* Creates a new IdentificationHeader with the given $name and $id.
*
* @param string $name
* @param Swift_Mime_Grammar $grammar
*/
public function __construct($name, Swift_Mime_Grammar $grammar)
{
$this->setFieldName($name);
parent::__construct($grammar);
}
示例2: __construct
/**
* Creates a new SimpleHeader with $name.
*
* @param string $name
* @param Swift_Mime_HeaderEncoder $encoder
* @param Swift_Mime_Grammar $grammar
*/
public function __construct($name, Swift_Mime_HeaderEncoder $encoder, Swift_Mime_Grammar $grammar)
{
$this->setFieldName($name);
$this->setEncoder($encoder);
parent::__construct($grammar);
}
示例3: tokenNeedsEncoding
/**
* Redefine the encoding requirements for mailboxes.
*
* Commas and semicolons are used to separate
* multiple addresses, and should therefore be encoded
*
* @param string $token
*
* @return bool
*/
protected function tokenNeedsEncoding($token)
{
return preg_match('/[,;]/', $token) || parent::tokenNeedsEncoding($token);
}
示例4: tokenNeedsEncoding
/**
* Redefine the encoding requirements for mailboxes.
*
* All "specials" must be encoded as the full header value will not be quoted
*
* @see RFC 2822 3.2.1
*
* @param string $token
*
* @return bool
*/
protected function tokenNeedsEncoding($token)
{
return preg_match('/[()<>\\[\\]:;@\\,."]/', $token) || parent::tokenNeedsEncoding($token);
}