Swift_Mime_Headers_UnstructuredHeader::getFieldBody PHP Method

getFieldBody() public method

Get the value of this header prepared for rendering.
public getFieldBody ( ) : string
return string
    public function getFieldBody()
    {
        if (!$this->getCachedValue()) {
            $this->setCachedValue($this->encodeWords($this, $this->_value));
        }
        return $this->getCachedValue();
    }

Usage Example

 public function getFieldBody()
 {
     if (!$this->getCachedValue()) {
         // ISO-2022-JP対応
         if (strcasecmp($this->getCharset(), 'iso-2022-jp') === 0) {
             // TODO:: エンコードを内包するパターンでSubjectがMIMEエンコードされているのを確認
             // subjectをセットする際にエンコードするのでここでは何もしない
             //$this->setCachedValue($this->getValue());
             // エンコード内包する場合。(本来はこちらが正しいかも)
             $this->setCachedValue(jpSimpleMail::mb_encode_mimeheader($this->getValue()));
         } else {
             parent::getFieldBody();
         }
     }
     return $this->getCachedValue();
 }
All Usage Examples Of Swift_Mime_Headers_UnstructuredHeader::getFieldBody