Note the upgraded forum! If you are experiencing issues logging in, you may need to reset your password which should send an email. If the email doesn't arrive, be sure to check your spam folder just in case.

Form module render method

edited March 13 in Modules
The default render method for the Form module seems to be 'table' - is it possible to use the config file to change that to 'div'?


  • edited 10:13AM
    I suppose you could create a form_builder.php config file and add the following:
    $config['render_format'] = 'div';
    However, that would change it globally and would likely make the admin area a mess. What areas are you needing it as a div? If it's in a module's form, there is a special field key you can use to specify Form Builder options:
    $fields['__FORM_BUILDER__']['render_format'] = 'div';
  • edited March 15
    Front end I always prefer divs - conceptually it's easier to extend Bootstrap sass to divs than table elements. Although, having written that, I don't think I've ever tried...!

    Client would like to use Form module in CMS pages, so it is there, in front end layouts, that I'd prefer divs.
  • edited March 21
    I got what I wanted by extending Fuel_forms(), and adding a new Fuel_form() function render_divs()

    I can then inject Bootstrap styles into the form fields (row_class=form-group, class=form-control) - Sass extensions only get you so far.
Sign In or Register to comment.