當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。