CodeIgniter Forums
Template Codeigniter - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forum-21.html)
+--- Thread: Template Codeigniter (/thread-56279.html)



Template Codeigniter - El Forum - 12-07-2012

[eluser]Pavellicus[/eluser]
hello,

i'm new about Codeigniter and i'm reading many tutorials in these days but i have some little questions..

now i have my codeigniter and i have a very wonderful template and i want to "merge" these two but i don't how.


if i understand good with CI i need to "destroy" pages of my template and create some Views like "headerA" "bodyB" "footerC" "headerB" "bodyA" "footerC" ecc...

and when (and where) i need i load this little piece in the controllers. is right?


and the second question is : i can put this template in one folder with .js and .css and i call his page and his object from controller or i need to do the process i write up?


Template Codeigniter - El Forum - 12-07-2012

[eluser]pickupman[/eluser]
I use a [url="http://getsparks.org/packages/template/versions/HEAD/show"]template library[/url] for generating the views. Yes, you are correct, you need to break your template into parts. On the parts of the template that will be on every page (header/footer + structure), keeps those in a view. Add in the variables for the content blocks/partials that will fill the template.

In your controller you would set the content for the variables in your template, then load the view of your template.