I'm trying to use str-replace() PHP String Functions for content of custom tag, class or id, in addition i want to understand Is it possible to use that or similar Functions in twig template?
To resolve this issue I wrote something like below code to my ThemeName.theme:
function ThemeName_preprocess_node(&$variables) {
$variables['<div class="info">']= str_replace(
array('A','B','C','D','E','F'),
array('1','2','3','4','5','6'),
$variables['<div class="info">']
);
}
I Try out Many different ways but I can't get any result.I would be happy to hear what the problem is and guide me to To resolve this problem.