I am creating multiple CodeIgniter views that could possibly be placed in any order by a controller. One of these views is a table of contents that I want to display the correct order of the views as they appear in the page. Is it possible to detect which order the views appear in and then change, add or remove elements from the table of contents?
I am creating multiple CodeIgniter views that could possibly be placed in any order
Share
CodeIgniter won’t be able to help you with it cause it renders the view instantly when you call
$this->load->view(...)(see the relevant code for view loading in the core Loader class).You’ll have to do your own logic for that, there’s nothing stopping you from creating an array with information about the views you need to load, and load your table of contents view beforehand: