![]() |
Nested arrays in parser with conditional rendering - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Model-View-Controller (https://forum.codeigniter.com/forumdisplay.php?fid=10) +--- Thread: Nested arrays in parser with conditional rendering (/showthread.php?tid=92709) |
Nested arrays in parser with conditional rendering - artursampaio - 04-02-2025 Hi,
I´d like to apply a conditional rendering in a nested iterator: Code: {parent} I tried to use a static index and it works, but would be necessary to know the current iterator index
Code: {parent} If there was something like:
Code: {if $parent[$parent_idx]->children[$children_idx]->someAttribute == "1"} Is this possible? There is any workaround? RE: Nested arrays in parser with conditional rendering - InsiteFX - 04-02-2025 Code: CREATE TABLE `categories` ( PHP Code: public function generateTree(array $data, int $parent = 0, int $depth = 0): string |