php - ZF2 how to wrap content in form fieldset?

196

I have form with fieldsets:

$formConfig = array(
    'fieldsets' => array(
        ...
    );
);

$factory = new Zend\Form\Factory();
$form = $factory->createForm($formConfig); 
echo $this->form($form);

It renders something like this:

<form>
    <fieldset>
        <legend>Fieldset label</legend>
        <label><span>Elem 1</span><input type="text" name="f1[el1]" /></label>
        <label><span>Elem 2</span><input type="text" name="f1[el2]" /></label>
        <label><span>Elem 3</span><input type="text" name="f1[el3]" /></label>
    </fielset>
</form>

The problem is that I need to wrap content after legend:

<form>
    <fieldset>
        <legend>Fieldset label</legend>
        <div class="wrapper">
            <label><span>Elem 1</span><input type="text" name="f1[el1]" /></label>
            <label><span>Elem 2</span><input type="text" name="f1[el2]" /></label>
            <label><span>Elem 3</span><input type="text" name="f1[el3]" /></label>
        <div>
    </fielset>
</form>

How can I do that?

People are also looking for solutions to the problem: javascript - Arabic support db,php & js

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.