bradcornford / Bootstrapper

An easy way to integrate Twitter Bootstrap with Laravel
MIT License
23 stars 15 forks source link

Inputs next to labels rather than above them #1

Closed seagullmouse closed 10 years ago

seagullmouse commented 10 years ago

E.g. my forms often look like this for longer forms, an extra div around the input

form-horizontal

    <div class="form-group">
        {{ Form::label('name', 'Your name', array('class'=> 'col-lg-2 control-label')) }}
        <div class="col-lg-10">{{ Form::text('name', '',array('class'=>
            'form-control', 'placeholder' => 'Your name')) }}
        </div>
    </div>
bradcornford commented 10 years ago

Will look into the possibility of adding this functionality and report back with my findings.

seagullmouse commented 10 years ago

This ready for me to try yet?? ta

bradcornford commented 10 years ago

I've created it on the develop branch, but haven't yet pushed it up. Just need some time to get it exactly how I want it to work.

bradcornford commented 10 years ago

I have now introduced this into develop if you would like to check it out. If its something that works well, i'll introduce it into master.

bradcornford commented 10 years ago

There are 3 new methods that have been added to Bootstrapper to set the form type Bootstrap::vertical() this is the default form type and require no parameters, horizontal() is for a horizontal based form this accepts input class and label class, and finally a Bootstrap::inline() method for an inline form, this only accepts a label class parameter.

These three methods are chain-able, so for example you can call "Bootstrap::inline()->text('Name', 'Value');". The set form type is then inherited into any form field that is created.

bradcornford commented 10 years ago

This has now been merged to master, and will be tagged in the next release.