Download the PHP package joshcanhelp/php-form-builder without Composer

On this page you can find all versions of the php package joshcanhelp/php-form-builder. 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 php-form-builder

PHP Form Builder by JoshCanHelp

This is a small PHP class that makes it easy to build and output forms as HTML or XHTML. Forms are tedious and can be difficult to build just right. Also, there are so many different option possible that it's easy to forget what you can do with them.

I tried to balance ease-of-use with flexibility and came up with something I find pretty darn helpful. I'm considering this a "beta" for the time being since it's only being used in a few applications and all the different options have not been exhaustively checked.

Give it a try and let me know what you like, hate, and think needs to be fixed.

Working with the form builder

The process for creating a form is simple:

  1. Instantiate the class
  2. Change any form attributes, if desired
  3. Add inputs, in order you want to see them
  4. Output the form

Let's walk through these one by one

1) Instantiate the class

This is pretty simple:

This uses all the default settings for the form, which are as follows:

Explanations for each of the settings are below

You can also instantiate by passing in a URL, which becomes the action for the form:

2) Change any form attributes, if desired

Once the form has been created, use the set_att function to change the default attributes:

Currently, there are some restrictions to what can be added but no check as to whether the classes or ids are valid so be mindful of that.

3) Add inputs, in order you want to see them

Inputs can be added one at a time or as a group. Either way, the order they are added is the order in which they'll show up.

Add fields using their label (in human-readable form), an array of settings, and a name/id slug, if needed.

Default and possible settings for field inputs (argument 2):

type

name

id

label

value

placeholder

class

options

min

max

step

autofocus

checked

required

add_label

wrap_tag

wrap_class

wrap_id

wrap_style

4) Output the form

One quick statement outputs the form as HTML:

Roadmap

There are a few things that I'd like to correct here and a few features to add. In order of priority:


All versions of php-form-builder with dependencies

PHP Build Version
Package Version
No informations.
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 joshcanhelp/php-form-builder contains the following files

Loading the files please wait ....