Does it make sense to use Codeigniter's form helper?

I think its easy to create a form via html only and not use a form helper. What is the advantage of using a form helper?

+3


source to share


4 answers


There are many benefits to using a form helper:

  • Activation to protect xss / csrf
  • Edit data for publication
  • Multilingual labels
  • Check
  • Unique db check
  • Easy shape modification
  • Easy set form field values

I recommend you see:



Form validation

Form Helper

Lang's assistant

+6


source


I found this useful primarily for two reasons:

  • form_open()

    can do a lot for you like resolving the action url, adding hidden CSRF fields, etc. If you later decide to enable / disable CSRF, this is a simple boolean switch if you have used this feature religiously.

  • form_dropdown()

    is a lifesaver, especially if you want to repopulate an existing value or provide a default value. I can think of very little when it's easier to write this logic by hand than to provide an array of data and a default.



Also, other features are genuine and depend on how you use validation, etc.

Since it is an assistant , only use it if it helps you.

+1


source


They help you create shapes. If you can do it, do it, I find that any automatic programs generate more harm and then help. This is because they often use cheap style to get what they want. In fact, they never choose the best solution, but the easiest one.

Also, please read the FAQ as I don't think the community would like a question like this.

0


source


I think the main benefit of using a form helper is that it can help with validation rules, input sanitization, and adding XSS protection.

0


source







All Articles