CodeIgniter Forums

Full Version: Dynamic code in header view
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]tjans[/eluser]
Two questions:

1.) Currently, I have a header and a footer and on every content controller action, I render the header view, my content view for that controller action, and then the footer view. It's a lot of duplicated code...is there a best practice for handling this situation?

2.) If I have a header view that spits out a menu, and that menu is rendered based on some variables. What's the best practice for this situation. Currently it seems like you'd have to either run that code and pass it in on ever action that renders the view, or put the menu code into the view, which seems bad...

El Forum

[eluser]InsiteFX[/eluser]
MY_Controller

InsiteFX