2017 © Pedro Peláez
 

silverstripe-module bootstrap-forms

Allows you to create forms in SilverStripe that are compatible with Twitter Bootstrap.

image

unclecheese/bootstrap-forms

Allows you to create forms in SilverStripe that are compatible with Twitter Bootstrap.

  • Saturday, November 12, 2016
  • by unclecheese
  • Repository
  • 12 Watchers
  • 61 Stars
  • 29,526 Installations
  • JavaScript
  • 6 Dependents
  • 1 Suggesters
  • 45 Forks
  • 17 Open issues
  • 20 Versions
  • 2 % Grown

The README.md

silverstripe-bootstrap-forms

Allows the creation of forms compatible with the Twitter Bootstrap CSS framework in SilverStripe 3., (*1)

Basic Usage

Just use the "BootstrapForm" subclass instead of Form., (*2)

<?php

$form = BootstrapForm::create(
  $this,
  "MyBootstrapForm",
  FieldList::create(
    TextField::create("Name")
      ->addHelpText('Enter some text above')
  ),
  FieldList::create(
    FormAction::create("doStuff","Click this!")
      ->setStyle("success")
  )
);

Bonus form fields

  • SimpleHtmlEditorField
  • ChosenDropdownField
  • Textarea with maxlength

The "Kitchen Sink" example

The following example showcases all of the options available on BootstrapForm and the BootstrapFormField extensions., (*3)

<?php
public function FancyForm() {
    return BootstrapForm::create(
        $this,
        "FancyForm",
        FieldList::create(
            TextField::create("ATextField","A text field with prepended and appended text")
                ->prependText("$")
                ->appendText(".00"),
            CheckboxSetField::create("InlineCheckboxes","Inline Checkboxes")
                ->setSource(DataList::create("SiteTree"))
                ->setInline(true),
            CheckboxSetField::create("Checkboxes","Checkboxes")
                ->setSource(DataList::create("SiteTree"))                   
                ->addHelpText("Check some of these."),
            OptionsetField::create("InlineRadios","Inline Radios")
                ->setSource(DataList::create("SiteTree")->map('ID','Title'))
                ->setInline(true),                  

            OptionsetField::create("Radios","Radios")
                ->setSource(DataList::create("SiteTree")->map('ID','Title'))                    
                ->addHelpText("Check one of these."),

            DropdownField::create("Dropdown","Dropdown")
                ->setSource(DataList::create("SiteTree")->map('ID','Title'))
                ->addInlineHelpText("<-- look at that!"),
            TextareaField::create("Textarea","Textarea"),
            TextField::create("BigText","Massive text field")
                ->setSize("xxlarge"),

            TextField::create("SmallText","Tiny text field")
                ->setSize("mini"),

            SimpleHtmlEditorField::create("HTML", "HTML Editor")
                ->setButtons("bold,italic"),
            ChosenDropdownField::create("FancyDropdown", "Fancy dropdown")
                ->setSource(SiteTree::get()->map()),
            TextareaField::create("MaxLengthTextarea","Textarea with a maxlength")
                ->setAttribute('maxlength',150)




        ),
        FieldList::create(
            FormAction::create("yes","YES!")
                ->setStyle("success"),
            FormAction::create("no","NO!")
                ->setStyle("danger"),
            FormAction::create("maybe","Maybe...")
                ->setStyle("info"),
            FormAction::create("sure","Sure!")
                ->setStyle("primary"),
            FormAction::create("uhoh","Uh-oh")
                ->setStyle("warning")
        )
    )
        ->addWell()
        ->setLayout("horizontal");  
    }

}



The Versions

12/11 2016

dev-master

9999999-dev

Allows you to create forms in SilverStripe that are compatible with Twitter Bootstrap.

  Sources   Download

BSD-3-Clause

The Requires

 

bootstrap silverstripe forms twitter

12/11 2016

1.2.0

1.2.0.0

Allows you to create forms in SilverStripe that are compatible with Twitter Bootstrap.

  Sources   Download

BSD-3-Clause

The Requires

 

bootstrap silverstripe forms twitter

26/10 2016

1.1.13

1.1.13.0

Allows you to create forms in SilverStripe that are compatible with Twitter Bootstrap.

  Sources   Download

BSD-3-Clause

The Requires

 

bootstrap silverstripe forms twitter

25/08 2016

1.1.12

1.1.12.0

Allows you to create forms in SilverStripe that are compatible with Twitter Bootstrap.

  Sources   Download

BSD-3-Clause

The Requires

 

bootstrap silverstripe forms twitter

21/01 2016

1.1.11

1.1.11.0

Allows you to create forms in SilverStripe that are compatible with Twitter Bootstrap.

  Sources   Download

BSD-3-Clause

The Requires

 

bootstrap silverstripe forms twitter

19/11 2015

1.1.10

1.1.10.0

Allows you to create forms in SilverStripe that are compatible with Twitter Bootstrap.

  Sources   Download

BSD-3-Clause

The Requires

 

bootstrap silverstripe forms twitter

21/10 2015

1.1.9

1.1.9.0

Allows you to create forms in SilverStripe that are compatible with Twitter Bootstrap.

  Sources   Download

BSD-3-Clause

The Requires

 

bootstrap silverstripe forms twitter

13/01 2015

1.1.8

1.1.8.0

Allows you to create forms in SilverStripe that are compatible with Twitter Bootstrap.

  Sources   Download

BSD-3-Clause

The Requires

 

bootstrap silverstripe forms twitter

22/12 2014

1.1.7

1.1.7.0

Allows you to create forms in SilverStripe that are compatible with Twitter Bootstrap.

  Sources   Download

BSD-3-Clause

The Requires

 

bootstrap silverstripe forms twitter

21/11 2014

1.1.6

1.1.6.0

Allows you to create forms in SilverStripe that are compatible with Twitter Bootstrap.

  Sources   Download

BSD-3-Clause

The Requires

 

bootstrap silverstripe forms twitter

27/10 2014

1.1.5

1.1.5.0

Allows you to create forms in SilverStripe that are compatible with Twitter Bootstrap.

  Sources   Download

BSD-3-Clause

The Requires

 

bootstrap silverstripe forms twitter

08/09 2014

1.1.4

1.1.4.0

Allows you to create forms in SilverStripe that are compatible with Twitter Bootstrap.

  Sources   Download

BSD-3-Clause

The Requires

 

bootstrap silverstripe forms twitter

15/07 2014

1.1.3

1.1.3.0

Allows you to create forms in SilverStripe that are compatible with Twitter Bootstrap.

  Sources   Download

BSD-3-Clause

The Requires

 

bootstrap silverstripe forms twitter

14/07 2014

1.1.2

1.1.2.0

Allows you to create forms in SilverStripe that are compatible with Twitter Bootstrap.

  Sources   Download

BSD-3-Clause

The Requires

 

bootstrap silverstripe forms twitter

07/07 2014

1.1.1

1.1.1.0

Allows you to create forms in SilverStripe that are compatible with Twitter Bootstrap.

  Sources   Download

BSD-3-Clause

The Requires

 

bootstrap silverstripe forms twitter

03/07 2014

dev-feature/bootstrap3

dev-feature/bootstrap3

Allows you to create forms in SilverStripe that are compatible with Twitter Bootstrap.

  Sources   Download

BSD-3-Clause

The Requires

 

bootstrap silverstripe forms twitter

17/06 2014

1.1.0

1.1.0.0

Allows you to create forms in SilverStripe that are compatible with Twitter Bootstrap.

  Sources   Download

BSD-3-Clause

The Requires

 

bootstrap silverstripe forms twitter

23/02 2014

1.0

1.0.0.0

Allows you to create forms in SilverStripe that are compatible with Twitter Bootstrap.

  Sources   Download

BSD-3-Clause

The Requires

 

bootstrap silverstripe forms twitter

23/02 2014

1.0.1

1.0.1.0

Allows you to create forms in SilverStripe that are compatible with Twitter Bootstrap.

  Sources   Download

BSD-3-Clause

The Requires

 

bootstrap silverstripe forms twitter

21/02 2014

dev-feature/button-group

dev-feature/button-group

Allows you to create forms in SilverStripe that are compatible with Twitter Bootstrap.

  Sources   Download

BSD-3-Clause

The Requires

 

bootstrap silverstripe forms twitter