On having templates - a basic design question |
[eluser]MEM[/eluser]
Hello, At this moment I have, on my controllers methods, something like: Code: $this->load->view('path/of/header.php', $someData); This is pure NO DRY and I realize that. Coded like this, we can't pass the header, footer and menu calls that are common cross-pages, into the MY_Controller construct because we need to get this in given order. So, I was thinking about doing something like this: Have a template were we can load the common views. On that template we have some placeholder that will be customized to fit a specific view. That injection will be made on MY_Controller construct. Question: Does this makes any sense, can I have a push please?\ Thanks in advance, MEM
[eluser]techgnome[/eluser]
check out this posting... http://ellislab.com/forums/viewreply/810202/ it's a example of how I manage it. -tg
[eluser]MEM[/eluser]
Thanks a lot. Can you or anyone else point me a design pattern that could be used on this scenario?
[eluser]WanWizard[/eluser]
Colin has good documentation on his website: http://williamsconcepts.com/ci/codeignit.../template/
[eluser]MEM[/eluser]
Thanks. I'm still wondering if there is a design pattern that rules all this... But that will surely be the way to go. |
Welcome Guest, Not a member yet? Register Sign In |