Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Better form template that works great with bootstrap
  • I'm currently working on using the Fieldset class and it feels like everything is ok except for the tables. Is there anyone using a different form template config that you might share? For some reason, the default config has regex-like appearance. I mean it's in one line and is hard to pathom at first. Thanks. Added:
    What is the difference between form_template and field_template set in the form config file?
  • Sadly, I lost the what should be an update for this topic because the forum required me to login again for the second time and lost all that I typed initially.
  • The forum has session issues every now and then, very annoying indeed. You can just login again, then back two pages in your browser, and submit the post again. I'm trying to understand what your initial question is, can you be more specific? The difference between the form_template and the field_template is that the first is for the form as a whole, the second is per input field in the form. The actual config depends greatly on the application, and its (layout) requirements. This is the one from the app I'm currently working on:
    return array(
     'prep_value'   => true,
     'auto_id'    => true,
     'auto_id_prefix'  => 'form_',
     'form_method'   => 'post',
     'form_template'   => "\t\t{form_open}\n<dl>{fields}</dl>\n\t\t{form_close}\n",
     'field_template'  => "\t\t\t<dt>{label}{required}</dt> <dd>{field} {icon} {error_msg}</dd>\n",
     'multi_field_template' => "\t\t\t{group_label}{required}\n {fields}\t\t\t<dt>{label}</dt> <dd>{field}</dd>{fields}",
     'required_mark'   => '<span class="required" rel="tooltip" title="'.__('global.required').'"></span>',
     'inline_errors'   => true,
     'error_template'  => '<div class="error">{error_msg}</div>',
     'icon_template'   => '<span class="fieldicon">{icon}</span>',
    );
    
  • Thanks for the reply. I'll look into your example but I was able to come up with something that works. I understand I might need to extend something if in case I really have to be meticulous. Sorry about the shameless grunt as I was having trouble getting answers earlier but through perseverance, I'm moving on. :)
  • Glad you've got it sorted.

Howdy, Stranger!

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

In this Discussion