[eluser]Unknown[/eluser]
I'm about to convert an extremely large project over to CI. However, i'm finding it difficult to grasp how i'm going to convert my exisiting templating system over to work in the CI framework.
Here is how my exisiting framework works:
- I'm using .htaccess as a router to route urls to specific php files
- on the php files, at the top we include a config file which includes on the other function files (i'm currently working procedual).
- on the php files, at the bottom, we call a template() function
- on the php files, the code is assigned to a variable which is globally passed to the template() function
- on the php files, we may set a few other global variables which will change the way the template reacts (ie: background color, width, etc)
My template file has alot of code in it which probably means i'll need to break it up its modular peices which each perform a function, call a mini view and return to the main template view.
On another note, I really want to seperate code and presentation and thus think I need to create 'mini views' for elements. Example, I may have a list of records, some of these records may have a database trigger which indicates it needs to be highlighted. I would think that I should pass this information to the view and the view then formats the highlight. What is the best practice for doing this?