Equavalent of Cake "Elements" |
[eluser]august.gresens[/eluser]
Hello I'm a recent convert to CI, having abandoned the intricacies of CakePHP for something a bit more transparent. There are a few features I miss, one being the "Elements" construct. I'm sure there is an easy way to do the same thing in CI. Do I just use include directives? Thanks, August
[eluser]m4rw3r[/eluser]
You can use $this->load->view(); inside another view to load subviews (or "view elements"). They share the same variables as the view that included them (I think).
[eluser]Bramme[/eluser]
You're right m4rw3r, it does share it... What often do is create an index view file that looks like this Code: <?php And then you can make your controller look like Code: //do lots of nifty things All variables passed to index, will get passed to footer, header and $page.
[eluser]august.gresens[/eluser]
After searching some more, I found this info on the forums with some code to do this: http://ellislab.com/forums/viewthread/66997/ A |
Welcome Guest, Not a member yet? Register Sign In |