Parser - Conditions in Loop - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: Parser - Conditions in Loop (/showthread.php?tid=88388) |
Parser - Conditions in Loop - ltarrant - 09-01-2023 Hi, Is it possible to use the basic allowed conditions in the parser within loops? If doesn't seem to be working for me. Code: {% if !empty($products) %} Code: {% if !empty($price_sellprice) %} Code: $parser->setConditionalDelimiters('{%', '%}'); Code: {% if !empty($products) %} RE: Parser - Conditions in Loop - kenjis - 09-03-2023 The following test passes. PHP Code: public function testParseLoop(): void RE: Parser - Conditions in Loop - ltarrant - 09-04-2023 (09-04-2023, 08:31 AM)ltarrant Wrote: I may not have explained the issue very well. RE: Parser - Conditions in Loop - ltarrant - 09-29-2023 To resolve my issues I ended up using Kenjis CI4 Twig Library and using Twig as a Template engine rather than the built in Parser. https://github.com/kenjis/codeigniter-ss-twig |