本文整理汇总了PHP中CRM_Utils_Token::parseThroughSmarty方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Utils_Token::parseThroughSmarty方法的具体用法?PHP CRM_Utils_Token::parseThroughSmarty怎么用?PHP CRM_Utils_Token::parseThroughSmarty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Utils_Token
的用法示例。
在下文中一共展示了CRM_Utils_Token::parseThroughSmarty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateHTML
/**
* generate htmlfor pdf letters
*
* @param array $membershipIDs
* @param array $returnProperties
* @param bool $skipOnHold
* @param bool $skipDeceased
* @param unknown_type $messageToken
* @param $html_message
* @param $categories
*
* @return unknown
*/
static function generateHTML($membershipIDs, $returnProperties, $skipOnHold, $skipDeceased, $messageToken, $html_message, $categories)
{
$memberships = CRM_Utils_Token::getMembershipTokenDetails($membershipIDs);
foreach ($membershipIDs as $membershipID) {
$membership = $memberships[$membershipID];
// get contact information
$contactId = $membership['contact_id'];
$params = array('contact_id' => $contactId);
//getTokenDetails is much like calling the api contact.get function - but - with some minor
// special handlings. It preceeds the existence of the api
list($contacts) = CRM_Utils_Token::getTokenDetails($params, $returnProperties, $skipOnHold, $skipDeceased, NULL, $messageToken, 'CRM_Contribution_Form_Task_PDFLetterCommon');
$tokenHtml = CRM_Utils_Token::replaceContactTokens($html_message, $contacts[$contactId], TRUE, $messageToken);
$tokenHtml = CRM_Utils_Token::replaceEntityTokens('membership', $membership, $tokenHtml, $messageToken);
$tokenHtml = CRM_Utils_Token::replaceHookTokens($tokenHtml, $contacts[$contactId], $categories, TRUE);
$tokenHtml = CRM_Utils_Token::parseThroughSmarty($tokenHtml, $contacts[$contactId]);
$html[] = $tokenHtml;
}
return $html;
}