Skip to content
Advertisement

Parse data between %%

could you please tell me if the string between %% can be parsed so that instead of displaying e.g. %offerroomlistBox% , I can render another view that will display the data I need.

view

I get the data from the database , their var_dump looks like this

var_dump of data

The only thing I use is ‘description’

I display the data on the ckeditor with the simplest

<textarea >
echo $this->templatesList[0]['description']
</textarea >

templatesList is a list taken from database in such way

    $TemplatesModel = new TemplatesModel();
    $this->view->templatesList = $TemplatesModel->getAll(['where'=>["kind='offers_email'"]]);

Advertisement

Answer

try this

echo str_replace('%','',$this->templatesList[0]['description']);

to learn about str_replace, please visit here https://www.php.net/manual/en/function.str-replace.php

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement