BASE . LOG, 'log_file_id' => $LOG_FILE_ID, 'log_per_date' => true, ]); // define a list of from to color sets for conversion test $PAGE_NAME = 'TEST CLASS: HTML BUILD: STRING REPLACE'; print ""; print "
" . htmlentities(StringReplace::replaceData(
$html_block,
[
'ID' => 'block-id',
'CSS' => join(',', ['blue', 'red']),
'{CONTENT}' => 'Some content here
with bla bla inside'
]
)) . "";
StringReplace::loadElements(
['foo', $html_block],
['bar', <<{CONTENT}
HTML]
);
print "Get: " . htmlentities(StringReplace::getElement('bar') ?: '') . '';
print "Build element: " . htmlentities(StringReplace::buildElement(
'bar',
[
'ID}' => 'new-id',
'{CONTENT' => 'Test cow 日本語'
]
)) . '' ;
print "Build element as replace: " . htmlentities(StringReplace::buildElement(
'bar',
['
ID}' => 'diff-id',
'{CONTENT' => 'Test cow 日本語. More text plus'
],
'rpl-1'
)) . '' ;
print "Get replacement: " . htmlentities(StringReplace::getReplaceBlock('rpl-1')) . "";
print "";
// __END__