当前位置: 首页>>代码示例>>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;未经允许,请勿转载。