Skip to content

How do I create a 'bootstrap-style checkbox' with bootstrapper? #261

@blueset

Description

@blueset

From Twitter bootstrap 3 documentation, they created a checkbox like this.

 <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <div class="checkbox">
        <label>
          <input type="checkbox"> Remember me
        </label>
      </div>
    </div>
  </div>

But when I write the code according to the Bootstrapper documentation, like this,

ControlGroup::generate(
    Form::label('control', ' '),
            [
                [
                    'label' => ['remember_me', 'Remember me'],
                    'input' => ['type' => 'checkbox', 'remember_me', 'Remember me']
                ]
            ],
    '',
    4
    )

And it comes out like this

<div class='form-group'>
  <label for="control" class="control-label col-sm-4">
  </label>
  <div class='col-sm-8'>
    <label for="remember" class="control-label">
      Remember me
    </label>
    <input name="first" type="checkbox" value="First" id="first">
    <br />
  </div>
</div>

The generated form looks a little strange and crowded. So is there anyway to prepend the checkbox inside the label?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions