Download the PHP package adamwathan/bootforms without Composer

On this page you can find all versions of the php package adamwathan/bootforms. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package bootforms

Important: This package is not actively maintained. For bug fixes and new features, please fork.

BootForms

This Project Has Been Deprecated. Code Climate Coverage Status

BootForms builds on top of my more general Form package by adding another layer of abstraction to rapidly generate markup for standard Bootstrap 3 forms. Probably not perfect for your super custom branded ready-for-release apps, but a huge time saver when you are still in the prototyping stage!

Installing with Composer

You can install this package via Composer by running this command in your terminal in the root of your project:

Laravel

If you are using Laravel 4 or 5, you can get started very quickly by registering the included service provider.

Modify the providers array in config/app.php to include the BootFormsServiceProvider:

Add the BootForm facade to the aliases array in config/app.php:

You can now start using BootForms by calling methods directly on the BootForm facade:

Outside of Laravel

Usage outside of Laravel is a little trickier since there's a bit of a dependency stack you need to build up, but it's not too tricky.

Note: You must provide your own implementations of AdamWathan\Form\OldInputInterface and AdamWathan\Form\ErrorStoreInterface when not using the implementations meant for Laravel.

Using BootForms

Basic Usage

BootForms lets you create a label and form control and wrap it all in a form group in one call.

Note: Don't forget to open() forms before trying to create fields! BootForms needs to know if you opened a vertical or horizontal form before it can render a field, so you'll get an error if you forget.

Customizing Elements

If you need to customize your form elements in any way (such as adding a default value or placeholder to a text element), simply chain the calls you need to make and they will fall through to the underlying form element.

Attributes can be added either via the attribute method, or by simply using the attribute name as the method name.

For more information about what's possible, check out the documentation for my basic Form package.

Reduced Boilerplate

Typical Bootstrap form boilerplate might look something like this:

BootForms makes a few decisions for you and allows you to pare it down a bit more:

Automatic Validation State

Another nice thing about BootForms is that it will automatically add error states and error messages to your controls if it sees an error for that control in the error store.

Essentially, this takes code that would normally look like this:

And reduces it to this:

...with the has-error class being added automatically if there is an error in the session.

Horizontal Forms

To use a horizontal form instead of the standard basic form, simply swap the BootForm::open() call with a call to openHorizontal($columnSizes) instead:

Additional Tips

Hiding Labels

You can hide labels by chaining the hideLabel() helper off of any element definition.

BootForm::text('First Name', 'first_name')->hideLabel()

The label will still be generated in the markup, but hidden using Bootstrap's .sr-only class, so you don't reduce the accessibility of your form.

Help Blocks

You can add a help block underneath a form element using the helpBlock() helper.

BootForm::text('Password', 'password')->helpBlock('A strong password should be long and hard to guess.')

Note: This help block will automatically be overridden by errors if there are validation errors.

Model Binding

BootForms makes it easy to bind an object to a form to provide default values. Read more about it here.

Related Resources


All versions of bootforms with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
adamwathan/form Version ^0.9.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package adamwathan/bootforms contains the following files

Loading the files please wait ....