Skip to content
This repository has been archived by the owner on Jul 10, 2020. It is now read-only.

Fix bug using twb-row-open and column-size options inside a form without fieldset #147

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alejandro-fiore
Copy link
Contributor

If i have the following entity (it's simplify)

class Entity {

    protected $name;

    /**
     * @Form\Options({
     *      "twb-row-open"  : true,
     *      "column-size"   : "md-4"
     * })
     */
    protected $start;

    /**
     * @Form\Options({
     *      "column-size"   : "md-4"
     * })
     *
     */
    protected $end;

    /**
     * @Form\Options({
     *      "twb-row-close" : true,
     *      "column-size"   : "md-4"
     * })
     */
    protected $count;

    protected $type;
}

The form rendered is (it's simplify)

<form>
    <div class="row">
        <div class="form-group">
              <label>Name</label>
              <input name="name" class="form-control" value="" type="text">
        </div>
        <div class="form-group  col-md-4">
              <label>Start</label>
              <input name="start" class="form-control" value="" type="date">
          </div>
          ....
    </div>
</form>

With the fix, now it's rendering like this:

<form>
    <div class="form-group">
             <label>Name</label>
             <input name="name" class="form-control" value="" type="text">
    </div>
    <div class="row">
        <div class="form-group  col-md-4">
                <label>Start</label>
                <input name="start" class="form-control" value="" type="date">
          </div>
          ....
    </div>
      ....
</form>

Fix bug when using twb-row-open, twb-row-close and column-size inside a form, not a collection.
Before, was always rendered all form elements inside a <div class="row">. Now open the <div class="row"> in the element with twb-row-open, and close it in the twb-row-close element.
@neilime
Copy link
Owner

neilime commented Jun 30, 2015

Please fix the broken phpunit tests

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants