当前位置: 首页>>代码示例>>PHP>>正文


PHP StringUtil::prependNewLine方法代码示例

本文整理汇总了PHP中StringUtil::prependNewLine方法的典型用法代码示例。如果您正苦于以下问题:PHP StringUtil::prependNewLine方法的具体用法?PHP StringUtil::prependNewLine怎么用?PHP StringUtil::prependNewLine使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在StringUtil的用法示例。


在下文中一共展示了StringUtil::prependNewLine方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testGetByContentTypeReturnsDefaultWithNoneSet

 /**
  * @depends testGetByContentTypeReturnsNullWithNoneSetAndNoDefault
  */
 public function testGetByContentTypeReturnsDefaultWithNoneSet()
 {
     $isHtmlContent = false;
     $unsubscribeUrlPlaceHolder = static::resolveUnsubscribeMergeTagContent($isHtmlContent);
     $manageSubscriptionsUrlPlaceHolder = static::resolveManageSubscriptionMergeTagContent($isHtmlContent);
     $recipientMention = 'This email was sent to [[PRIMARY^EMAIL]].';
     StringUtil::prependNewLine($unsubscribeUrlPlaceHolder, $isHtmlContent);
     StringUtil::prependNewLine($manageSubscriptionsUrlPlaceHolder, $isHtmlContent);
     StringUtil::prependNewLine($recipientMention, $isHtmlContent);
     $defaultFooter = $unsubscribeUrlPlaceHolder . $manageSubscriptionsUrlPlaceHolder . $recipientMention;
     $plainTextFooter = GlobalMarketingFooterUtil::getContentByType($isHtmlContent);
     $this->assertNotNull($plainTextFooter);
     $this->assertEquals($defaultFooter, $plainTextFooter);
     $isHtmlContent = true;
     $unsubscribeUrlPlaceHolder = static::resolveUnsubscribeMergeTagContent($isHtmlContent);
     $manageSubscriptionsUrlPlaceHolder = static::resolveManageSubscriptionMergeTagContent($isHtmlContent);
     $recipientMention = 'This email was sent to [[PRIMARY^EMAIL]].';
     StringUtil::prependNewLine($unsubscribeUrlPlaceHolder, $isHtmlContent);
     StringUtil::prependNewLine($manageSubscriptionsUrlPlaceHolder, $isHtmlContent);
     StringUtil::prependNewLine($recipientMention, $isHtmlContent);
     $defaultFooter = $unsubscribeUrlPlaceHolder . $manageSubscriptionsUrlPlaceHolder . $recipientMention;
     $richTextFooter = GlobalMarketingFooterUtil::getContentByType($isHtmlContent);
     $this->assertNotNull($richTextFooter);
     $this->assertEquals($defaultFooter, $richTextFooter);
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:28,代码来源:GlobalMarketingFooterUtilTest.php

示例2: resolveDefaultValue

 protected static function resolveDefaultValue($isHtmlContent)
 {
     $unsubscribeUrlPlaceHolder = static::UNSUBSCRIBE_URL_PLACEHOLDER;
     $manageSubscriptionsUrlPlaceHolder = static::MANAGE_SUBSCRIPTIONS_URL_PLACEHOLDER;
     StringUtil::prependNewLine($unsubscribeUrlPlaceHolder, $isHtmlContent);
     StringUtil::prependNewLine($manageSubscriptionsUrlPlaceHolder, $isHtmlContent);
     $content = $unsubscribeUrlPlaceHolder . $manageSubscriptionsUrlPlaceHolder;
     return $content;
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:9,代码来源:UnsubscribeAndManageSubscriptionsPlaceholderUtil.php

示例3: testGetByContentTypeReturnsDefaultWithNoneSet

 /**
  * @depends testGetByContentTypeReturnsNullWithNoneSetAndNoDefault
  */
 public function testGetByContentTypeReturnsDefaultWithNoneSet()
 {
     $isHtmlContent = false;
     $unsubscribeUrlPlaceHolder = UnsubscribeAndManageSubscriptionsPlaceholderUtil::UNSUBSCRIBE_URL_PLACEHOLDER;
     $manageSubscriptionsUrlPlaceHolder = UnsubscribeAndManageSubscriptionsPlaceholderUtil::MANAGE_SUBSCRIPTIONS_URL_PLACEHOLDER;
     StringUtil::prependNewLine($unsubscribeUrlPlaceHolder, $isHtmlContent);
     StringUtil::prependNewLine($manageSubscriptionsUrlPlaceHolder, $isHtmlContent);
     $defaultFooter = $unsubscribeUrlPlaceHolder . $manageSubscriptionsUrlPlaceHolder;
     $plainTextFooter = UnsubscribeAndManageSubscriptionsPlaceholderUtil::getContentByType($isHtmlContent);
     $this->assertNotNull($plainTextFooter);
     $this->assertEquals($defaultFooter, $plainTextFooter);
     $isHtmlContent = true;
     $unsubscribeUrlPlaceHolder = UnsubscribeAndManageSubscriptionsPlaceholderUtil::UNSUBSCRIBE_URL_PLACEHOLDER;
     $manageSubscriptionsUrlPlaceHolder = UnsubscribeAndManageSubscriptionsPlaceholderUtil::MANAGE_SUBSCRIPTIONS_URL_PLACEHOLDER;
     StringUtil::prependNewLine($unsubscribeUrlPlaceHolder, $isHtmlContent);
     StringUtil::prependNewLine($manageSubscriptionsUrlPlaceHolder, $isHtmlContent);
     $defaultFooter = $unsubscribeUrlPlaceHolder . $manageSubscriptionsUrlPlaceHolder;
     $richTextFooter = UnsubscribeAndManageSubscriptionsPlaceholderUtil::getContentByType($isHtmlContent);
     $this->assertNotNull($richTextFooter);
     $this->assertEquals($defaultFooter, $richTextFooter);
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:24,代码来源:UnsubscribeAndManageSubscriptionsPlaceholderUtilTest.php

示例4: appendDefaultFooter

 protected static function appendDefaultFooter(&$content, $isHtmlContent)
 {
     $placeholderContent = static::resolveDefaultFooterPlaceholderContentByType($isHtmlContent);
     StringUtil::prependNewLine($placeholderContent, $isHtmlContent);
     $content .= $placeholderContent;
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:6,代码来源:GlobalMarketingFooterUtil.php

示例5: resolveUnsubscribeAndManageSubscriptionPlaceholders

 /**
  * @param string $content
  * @param int $personId
  * @param int $marketingListId
  * @param int $modelId
  * @param $modelType
  * @param bool $isHtmlContent
  * @param bool $replaceExisting
  * @param bool $preview
  */
 public static function resolveUnsubscribeAndManageSubscriptionPlaceholders(&$content, $personId, $marketingListId, $modelId, $modelType, $isHtmlContent, $replaceExisting = false, $preview = false)
 {
     $hash = static::resolveHashForUnsubscribeAndManageSubscriptionsUrls($personId, $marketingListId, $modelId, $modelType, !$preview);
     $unsubscribeUrl = static::resolveUnsubscribeUrl($hash, $preview);
     $manageSubscriptionsUrl = static::resolveManageSubscriptionsUrl($hash, $preview);
     static::resolvePlaceholderUrlsForHtmlContent($unsubscribeUrl, $manageSubscriptionsUrl, $isHtmlContent);
     if ($replaceExisting) {
         static::resolveUnsubscribeAndManageSubscriptionPlaceholdersToUrls($content, $unsubscribeUrl, $manageSubscriptionsUrl);
     } else {
         $placeholderContent = static::resolveDefaultFooterPlaceholderContentByType($isHtmlContent);
         static::resolveUnsubscribeAndManageSubscriptionPlaceholdersToUrls($placeholderContent, $unsubscribeUrl, $manageSubscriptionsUrl);
         StringUtil::prependNewLine($placeholderContent, $isHtmlContent);
         $content .= $placeholderContent;
     }
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:25,代码来源:EmailMessageActivityUtil.php


注:本文中的StringUtil::prependNewLine方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。