if (value('AB01_01') == 1) {
$desc = getTextElement('desc1', 'html');
} else {
$desc = getTextElement('desc2', 'html');
}
replace('%desc%', $desc);
text('description');
===== Example 2 =====
In the following example, each "a" and each "A" is replaced with an underscore, and the text element is subsequently displayed.
$content = getTextElement('priming');
$out = str_replace(array('a','A'), '_', $content);
html($out);
===== Example 3 =====
Here, a text ''TX01'' with the display "HTML code" was defined, which contains several placeholders:
This text element is used several times in the questionnaire, and the placeholders are filled differently each time, e.g.
$html = '';
$html.= getTextElement('TX01', [
'%num%' => 1,
'%image%' => 'image01.jpg',
'%source.logo%' => 'source07.png',
'%source.name%' => '24/4 News',
'%headline%' => 'ABC representatives visit Helsinki, difficult talks expected.',
'format' => 'html'
]);
$html.= '';
html($html);