當前位置: 首頁>>代碼示例>>PHP>>正文


PHP MailUtility::breakLinesForEmail方法代碼示例

本文整理匯總了PHP中TYPO3\CMS\Core\Utility\MailUtility::breakLinesForEmail方法的典型用法代碼示例。如果您正苦於以下問題:PHP MailUtility::breakLinesForEmail方法的具體用法?PHP MailUtility::breakLinesForEmail怎麽用?PHP MailUtility::breakLinesForEmail使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在TYPO3\CMS\Core\Utility\MailUtility的用法示例。


在下文中一共展示了MailUtility::breakLinesForEmail方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: renderInternal

 /**
  * Render the given element
  *
  * @return array
  */
 public function renderInternal()
 {
     $headerWrap = MailUtility::breakLinesForEmail(trim($this->contentObject->data['header']), LF, Configuration::getPlainTextWith());
     $subHeaderWrap = MailUtility::breakLinesForEmail(trim($this->contentObject->data['subheader']), LF, Configuration::getPlainTextWith());
     // align
     $header = array_merge(GeneralUtility::trimExplode(LF, $headerWrap, TRUE), GeneralUtility::trimExplode(LF, $subHeaderWrap, TRUE));
     if ($this->contentObject->data['header_position'] == 'right') {
         foreach ($header as $key => $l) {
             $l = trim($l);
             $header[$key] = str_pad(' ', Configuration::getPlainTextWith() - strlen($l), ' ', STR_PAD_LEFT) . $l;
         }
     } elseif ($this->contentObject->data['header_position'] == 'center') {
         foreach ($header as $key => $l) {
             $l = trim($l);
             $header[$key] = str_pad(' ', floor((Configuration::getPlainTextWith() - strlen($l)) / 2), ' ', STR_PAD_LEFT) . $l;
         }
     }
     $header = implode(LF, $header);
     $lines[] = $header;
     return $lines;
 }
開發者ID:ercuement,項目名稱:ink,代碼行數:26,代碼來源:Header.php

示例2: breakLines

 /**
  * Breaking lines into fixed length lines, using GeneralUtility::breakLinesForEmail()
  *
  * @param string $content The string to break
  * @param array $conf Configuration options: linebreak, charWidth; stdWrap enabled
  *
  * @return string Processed string
  * @see GeneralUtility::breakLinesForEmail()
  */
 public function breakLines($content, array $conf)
 {
     $linebreak = $GLOBALS['TSFE']->cObj->stdWrap($conf['linebreak'] ? $conf['linebreak'] : chr(32) . LF, $conf['linebreak.']);
     $charWidth = $GLOBALS['TSFE']->cObj->stdWrap($conf['charWidth'] ? intval($conf['charWidth']) : 76, $conf['charWidth.']);
     return MailUtility::breakLinesForEmail($content, $linebreak, $charWidth);
 }
開發者ID:kartolo,項目名稱:direct_mail,代碼行數:15,代碼來源:Container.php

示例3: breakLinesForEmailBreaksTextIfLineIsLongerThanTheLineWidth

 /**
  * @test
  */
 public function breakLinesForEmailBreaksTextIfLineIsLongerThanTheLineWidth()
 {
     $str = 'Mein Link auf eine News (Link: http://zzzzzzzzzzzzz.xxxxxxxxx.de/index.php?id=10&tx_ttnews%5Btt_news%5D=1&cHash=66f5af320da29b7ae1cda49047ca7358)';
     $returnString = \TYPO3\CMS\Core\Utility\MailUtility::breakLinesForEmail($str);
     $this->assertEquals($returnString, 'Mein Link auf eine News (Link:' . LF . 'http://zzzzzzzzzzzzz.xxxxxxxxx.de/index.php?id=10&tx_ttnews%5Btt_news%5D=1&cHash=66f5af320da29b7ae1cda49047ca7358)');
 }
開發者ID:khanhdeux,項目名稱:typo3test,代碼行數:9,代碼來源:MailUtilityTest.php

示例4: breakLines

 /**
  * Breaking lines into fixed length lines, using GeneralUtility::breakLinesForEmail()
  *
  * @param        string  $str       : The string to break
  * @param        string  $implChar  : Line break character
  * @param        integer $charWidth : Length of lines, default is $this->charWidth
  *
  * @return        string                Processed string
  */
 function breakLines($str, $implChar = LF, $charWidth = FALSE)
 {
     $charWidth = $charWidth === FALSE ? Configuration::getPlainTextWith() : (int) $charWidth;
     return MailUtility::breakLinesForEmail($str, $implChar, $charWidth);
 }
開發者ID:ercuement,項目名稱:ink,代碼行數:14,代碼來源:AbstractRendering.php

示例5: breakLinesForEmailBreaksTextWithNoSpaceFoundBeforeLimit

 /**
  * @test
  */
 public function breakLinesForEmailBreaksTextWithNoSpaceFoundBeforeLimit()
 {
     $newlineChar = LF;
     $lineWidth = 10;
     // first space after 20 chars (more than $lineWidth)
     $str = 'abcdefghijklmnopqrst uvwxyz 123456';
     $returnString = \TYPO3\CMS\Core\Utility\MailUtility::breakLinesForEmail($str, $newlineChar, $lineWidth);
     $this->assertEquals($returnString, 'abcdefghijklmnopqrst' . LF . 'uvwxyz' . LF . '123456');
 }
開發者ID:nicksergio,項目名稱:TYPO3v4-Core,代碼行數:12,代碼來源:MailUtilityTest.php

示例6: breakLines

 /**
  * Breaking lines into fixed length lines, using MailUtility::breakLinesForEmail()
  *
  * @param	string		$str: The string to break
  * @param	string		$implChar: Line break character
  * @param	integer		$charWidth: Length of lines, default is $this->charWidth
  * @return	string		Processed string
  * @see MailUtility::breakLinesForEmail()
  */
 function breakLines($str, $implChar, $charWidth = 0)
 {
     $cW = $charWidth ? $charWidth : $this->charWidth;
     $linebreak = $implChar ? $implChar : $this->linebreak;
     return MailUtility::breakLinesForEmail($str, $linebreak, $cW);
 }
開發者ID:preinboth,項目名稱:direct_mail,代碼行數:15,代碼來源:class.tx_directmail_pi1.php


注:本文中的TYPO3\CMS\Core\Utility\MailUtility::breakLinesForEmail方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。