CI's form helper—entering data
Let's move on to see how you use your HTML pages. One of the most important parts of any dynamic site is interaction with the users, and this usually means HTML forms.
The CI form helper is a very useful piece of code. It introduces a slightly different syntax, which makes form creation easier. Let's build a form that allows you to enter data on your site about a new website. In the sites
table, we want to enter the name, type, and URL of the website, and the date when it was updated.
You can build the form as a simple HTML file, or you can build it inside a controller, then pack it into a variable, call a view, and pass the variable to the view. We will do it the second way. You can also write it entirely in the ...
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.