Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Add to Fieldset
  • Hi today i tried the Fieldset-Class, but i didn't find out how to add a <fieldset> to the Fieldset to Group my items :-D Thanks for the help and the nice Newbie-friendly Framework :-D
  • Hello psren, and welcome here. Just to be sure, you know the Fieldset class has nothing to do with the HTML tag of the same name? To generate tags, check out the Html class, or the Form class (for form building).
  • ...you can however create a second Fieldset instance which you pass into another (the main instance) using add() and the sub-fieldset will be embedded into the main fieldset inside <fieldset></fieldset> tags.
    $fs = Fieldset::forge();
    $fs1 = Fieldset::forge('sub');
    $fs1->add('example', 'Example');
    $fs->add($fs1);
    

    When rendered this generates something along these lines:
    <form action="..." ...>
    <fieldset>
    <label>Example</label><input type="text" name="example" />
    </fieldset>
    </form>
    
  • Thank you very much for the very very quick answer.
    Jelmer you got the point. I know the Fieldset Class has nothing to do with a Fieldset, but i missed how to add html-fieldsets to the Form. You made me very happy :-D

Howdy, Stranger!

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

In this Discussion