replacements_helper.php
Table of Contents
Functions
- templatereplace() : string
- This function replaces keywords in a text and is mainly intended for templates Replacement done on this function can not be used in Expression for condition or equation If you want keywords available on both replacement and condition, use LimeExpressionManager::setValueToKnowVar Or add it in LimeExpressionManager->setVariableAndTokenMappingsForExpressionManager If you use this functions put your replacement strings into the $replacements variable instead of using global variables NOTE - Don't do any embedded replacements in this function. Create the array of replacement values and they will be done in batch at the end
- getStandardsReplacementFields() : mixed
- This function replaces keywords in a text Replacement done on this function can not be used in Expression for condition or equation If you want keywords available on both replacement and condition, use LimeExpressionManager::setValueToKnowVar Or add it in LimeExpressionManager->setVariableAndTokenMappingsForExpressionManager
- ReplaceFields() : mixed
- PassthruReplace() : string
- passthruReplace() takes a string and looks for {PASSTHRU:myarg} variables which it then substitutes for parameter data sent in the initial URL and stored in the session array containing responses
Functions
templatereplace()
This function replaces keywords in a text and is mainly intended for templates Replacement done on this function can not be used in Expression for condition or equation If you want keywords available on both replacement and condition, use LimeExpressionManager::setValueToKnowVar Or add it in LimeExpressionManager->setVariableAndTokenMappingsForExpressionManager If you use this functions put your replacement strings into the $replacements variable instead of using global variables NOTE - Don't do any embedded replacements in this function. Create the array of replacement values and they will be done in batch at the end
templatereplace(string $line[, array<string|int, string> $replacements = array() ][, array<string|int, mixed> &$redata = array() ][, null $debugSrc = null ][, null $anonymized = null ][, int|null $questionNum = null ][, null|void $registerdata = array() ][, mixed $bStaticReplacement = false ][, mixed $oTemplate = '' ]) : string
Parameters
- $line : string
-
Text to search in
- $replacements : array<string|int, string> = array()
-
Array of replacements: Array(
=> - $redata : array<string|int, mixed> = array()
-
: array of global var used in the function
- $debugSrc : null = null
-
unused
- $anonymized : null = null
-
unused (all done in EM now)
- $questionNum : int|null = null
-
- needed to support dynamic JavaScript-based tailoring within questions
- $registerdata : null|void = array()
-
- deprecated
- $bStaticReplacement : mixed = false
- $oTemplate : mixed = ''
Tags
Return values
string —Text with replaced strings
getStandardsReplacementFields()
This function replaces keywords in a text Replacement done on this function can not be used in Expression for condition or equation If you want keywords available on both replacement and condition, use LimeExpressionManager::setValueToKnowVar Or add it in LimeExpressionManager->setVariableAndTokenMappingsForExpressionManager
getStandardsReplacementFields(mixed $thissurvey) : mixed
Parameters
- $thissurvey : mixed
Tags
ReplaceFields()
ReplaceFields(mixed $text, mixed $fieldsarray[, mixed $bReplaceInsertans = true ][, mixed $staticReplace = true ]) : mixed
Parameters
- $text : mixed
- $fieldsarray : mixed
- $bReplaceInsertans : mixed = true
- $staticReplace : mixed = true
PassthruReplace()
passthruReplace() takes a string and looks for {PASSTHRU:myarg} variables which it then substitutes for parameter data sent in the initial URL and stored in the session array containing responses
PassthruReplace(mixed $line, mixed $thissurvey) : string
Parameters
- $line : mixed
-
string - the string to iterate, and then return
- $thissurvey : mixed
-
string - the string containing the surveyinformation
Return values
string —This string is returned containing the substituted responses