This chapter covers yet another way in which CI helps save your time and makes your coding more rigorous and logical. Firstly, we'll cover various ways of building views—the pages that control the way you see the results prepared by your controllers and models. Next, you'll see how to create HTML forms quickly, with built-in safeguards, and you'll also see how to validate your forms.
We assume that the readers of this book are familiar with HTML and CSS. The following examples are very simplified, so we can focus on the CI code. We have assumed that you have already written a CSS file and tucked it away somewhere on your site.
A view controls how the user sees your website. Views make it easy for you to present a consistent interface, and to change it if you need to. One of the advantages of MVC is that you separate presentation from logic, keeping everything much cleaner.
So far, all we've done is look at the very simple welcome
view...