CodeIgniter Forums
Codeigniter form helper VS Html forms - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6)
+--- Forum: CodeIgniter 2.x (https://forum.codeigniter.com/forumdisplay.php?fid=18)
+--- Thread: Codeigniter form helper VS Html forms (/showthread.php?tid=42)



Codeigniter form helper VS Html forms - FlevasGR - 10-28-2014

Hello, this is my third day on CodeIgniter course and i was wondering if CodeIgniter's forms are better than html and why?

Both seem to do the exact same thing and both are pretty easy to use but i don't get why should i use PHP in order to render them.


RE: Codeigniter form helper VS Html forms - peterdenk - 10-28-2014

Using PHP saves you from making typos and also makes it very easy to change the HTML of a certain type of form field all over your site.

Personally I prefer to use FormGenLib (frankmichel.de/formgenlib/user_guide/) to generate most of my forms. It makes for simple, easy to understand clean code, saves me from having to make one view-file for each form and has built in handling of the validation. The fields of the form is instead defined in the controller. Sadly Frank hasn't developed FormGenLib since about the same time as CI development slowed down. But it's open source so it's up to anyone.


RE: Codeigniter form helper VS Html forms - FlevasGR - 10-28-2014

From the performance aspect which is faster?


RE: Codeigniter form helper VS Html forms - peterdenk - 10-28-2014

fastest >> html > CI helper > FormGenLib >> slowest

But unless you have a large number of simultaneous users there is no difference that neither you or your visitors will notice.


RE: Codeigniter form helper VS Html forms - FlevasGR - 10-28-2014

I'll probably stick with CI's forms because they look better Smile