Template Parse Class - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Template Parse Class (/showthread.php?tid=67726) |
Template Parse Class - MoFish - 04-01-2017 Hi, I'm wondering if anyone can help. I'm trying to create a little render of mark-up using the parse_template class and am a little stuck. To demonstrate my crazy thinking, I have made the following array in my controller. PHP Code: $data = array( and have the following tags in my view: Code: {heading} I parse the template which outputs the following mark-up to my browser which in theory is correct, however I want to go a step further and then have it replace {image}, {alternative}, and {value} with the value from the array. Its kind of like a double parse. I've tried to get it working using parse_string without success. Any ideas much appriciated. Code: <img src="{image}" alt="{alternative}" /> Regards, MoFish |