Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Form Helper Class
  • Hi, Loving Fuel. I was going to create a Form Helper class as there isn't one their currently. So I was wondering if anyone had done one already that I missed or what features people would like. I was going to base it on the CI form helper. (http://codeigniter.com/user_guide/helpers/form_helper.html) But do is as an actual class rather than a load of functions. All suggestions welcome. Cheers,
    Steve
  • jschreuder: there is a form class, nice... But the class could have some tuning. For example: form_open_multipart() And a Cross-site request forgery (CSRF) implementation I'll start playing with the class and tell here if I miss more.
  • I'm quite sure it could use some tuning, feel free to do so and pull-request.
    For example: form_open_multipart()
    I guess you mean Form::open_multipart() :P, it could be added but not absolutely neccesary. The following works just fine as well: Form::open(array('enctype' => 'multipart/form-data'));
    And a Cross-site request forgery (CSRF) implementation
    There's CSRF tools in the security class, it hasn't been integrated with the Form class but I disagree with the way CI has done this. People should handle the security in app specific ways and understand what they're doing, if they don't they're going to run into trouble anyway. You can't protect against stupidity. A good way to do it would be to add some option to validation that checks CSRF and a setting to creating forms that auto-adds the hidden field and validation. But this hasn't been implemented yet.
  • It's not yet documented but there is already a very complete Form class. Which works both as a helper and through the Fieldset class as a more OO form builder.
  • http://kohanaframework.org/guide/api/Form Kohana's is perfect. You could use it - just have to modify some of it's dependencies to work with fuel
  • Let me just repeat what I said before: "there is already a very complete Form class".

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion