Nesting views

So far, irrespective of whether we use long or short PHP formats, this is pretty crude HTML. It would be nice, for instance, to put more information in the <head> section of the page. Better still, if this could be a standard chunk of each page. Once again, something we have to write (or alter) only once, and can reuse it, by nesting this view inside other views whenever we need the boring HTML header stuff.

Let's create a page header "view" for our site, which displays a standard page header, as well as HTML declarations and meta-information.

First, we type the code for our "nested" header view:

<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN''><html xmlns=''> ...

Get CodeIgniter 1.7 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.