Welcome Guest, Not a member yet? Register   Sign In
General view construction - best practise
#1

[eluser]prezet[/eluser]
Hi

I'm new to CI, I've worked with PHP quite a bit before, although I'm actually a client-side developer, and used to working on either small hand crafted sites, or larger ones built on our in-house CMS.

So, I'm wondering if anyone can direct me to useful reading (yes, I've gone through the CI documentation), or offer advice on the best way of starting to work with 'views'. i.e. How to apply page titles, use headers and footers etc, and general construction for the more common 'day to day' tasks.

I'm sure there are a dozen different ways of doing this, but I'm looking at using CI on a new small site I've got coming up, and would like to get into good habits before moving onto slightly more complicated stuff.

Any help would be great.

Also, are there any decent books out on the market worth reading?

Thanks
#2

[eluser]xwero[/eluser]
If you are used to a templating engine just use that to construct your views, moving over to CI doesn't mean you have to abandon everything you already have.

I'm a big fan of the template inheritance helper which keeps the view stuff in the views like header, footer and you only have to take care of the different parts in the view.

For more complex views you can go with a modular library to keep the scope of the variables you have to pass to the view as local as possible.
#3

[eluser]sophistry[/eluser]
things you wish you knew about CI before you started.




Theme © iAndrew 2016 - Forum software by © MyBB