本文整理汇总了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);
}
示例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;
}
示例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);
}
示例4: appendDefaultFooter
protected static function appendDefaultFooter(&$content, $isHtmlContent)
{
$placeholderContent = static::resolveDefaultFooterPlaceholderContentByType($isHtmlContent);
StringUtil::prependNewLine($placeholderContent, $isHtmlContent);
$content .= $placeholderContent;
}
示例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;
}
}