CI 3.1.0 - parse folder - 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: CI 3.1.0 - parse folder (/showthread.php?tid=71126) |
CI 3.1.0 - parse folder - angecorse - 07-09-2018 Hi forum, Actually In my Index controller i have $data with among others : PHP Code: 'sectionFiles' => ['rightmenu', 'home_slider', 'infobox', 'seoscore', 'home_offers', 'video_feature', 'services_blocks', 'counters', 'home_expertiseintro'], In views/site/sections I cut each page into several files and in the file template.php I have : PHP Code: <?php I would add some php code to : 1. parse site/sections/ 2. make an array 3. compare with $data 4. display only files who are featured in $data Could oyu please help me ? Regards and nice da y ! RE: CI 3.1.0 - parse folder - jreklund - 07-10-2018 Why do you need to compare it? It will only loop through whatever you put in it. So delete some values from sectionFiles and it will not load them. |