Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Fieldset class - adding custom html elements in the middle of the form
  • Is there any other solution to inject some html in the middle of the form when using Fieldset class?
    The only solution i found is using add() and set_template() together, however it doesn't look so correct. It looks more of a hack, rather than solution
    $fieldset->add('legend')->set_template('<legend>Legend title</legend>');
    

    I even extended Fieldset with this awkward method, so that i can add some other unsupported form or html elements, like separators and so on:
    public function add_html($html)
    {
     $this->add(\Str::truncate(\Inflector::friendly_title($html, '_'), 24, '').rand(1000,9999))->set_template($html);
    }
    

    Maybe there could be some more appropriate and more DOM like function so you can add any HTML element in the middle of Fieldset? Any other options or suggestions?
    Thanks

Howdy, Stranger!

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