Download the PHP package jayrchamp/simple-php-form-builder without Composer
On this page you can find all versions of the php package jayrchamp/simple-php-form-builder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download jayrchamp/simple-php-form-builder
More information about jayrchamp/simple-php-form-builder
Files in jayrchamp/simple-php-form-builder
Download jayrchamp/simple-php-form-builder
More information about jayrchamp/simple-php-form-builder
Files in jayrchamp/simple-php-form-builder
Vendor jayrchamp
Package simple-php-form-builder
Short Description Yet another php form builder
License MIT
Homepage https://github.com/champjr/simple-php-form-builder
Package simple-php-form-builder
Short Description Yet another php form builder
License MIT
Homepage https://github.com/champjr/simple-php-form-builder
Please rate this library. Is it a good library?
Informations about the package simple-php-form-builder
Installation
Basic Usage
- Getting Started
- #1 Instantiate the class
- #2 Add the required methods to the form object
- #3 Add form fields
- #4 Add a submit field
- #5 Close the form
- More examples
Getting Started
1) Instantiate the class
2) Add the required methods (attribute) to the form object and open the form for fields
Methods ( attributes )
-
action
- The action to be performed when the form is submitted.
- (string) (Required)
-
method
- Accepts
GET
,POST
. - (string) (Optional) (Default
POST
)
- Accepts
-
enctype
- Accepts
multipart/form-data
,application/x-www-form-urlencoded
. - (string) (Optional) (Default
multipart/form-data
)
- Accepts
-
id
- Form's id attribute.
- (string) (Optional)
-
class
- Form's classes as an array or string.
- (array | string ) (Optional)
attr
- A key-value pair array of custom attributes with their associated value.
- Or a string of a single attribute
- (array | string) (Optional) (Default
[]
)
Action methods
open
- Creates the form and gets it ready to receive field inputs.
- Needs to be the last method added on the form object.
- (void) (Required)
Complete example ( form's instantiation )
3) Add form fields
Methods ( attributes )
-
field
- Field's type.
- (string) (Required)
-
label
- Field's label
- (string) (Required)
-
name
- Field's name attribute.
- If not set, label will be slugified and added as field name attribute.
- If you set it, it will automatically be slugified for you. Not need to add underscore, etc.
- It will keep the square brackets, if you need an array.
- (string) (Optional) (Default
Slugified label
)
-
value
- Field's value attribute
- (string) (Optional) (Default
''
)
-
id
- Form's id attribute.
- (string) (Optional)
-
class
- Form's classes as an array or string.
- (array | string ) (Optional)
-
placeholder
- Field's placeholder
- (string) (Optional) (Default
''
)
attr
- A key-value pair array of custom attributes with their associated value.
- Or a string of a single attribute
- (array) (Optional) (Default
[]
)
Action methods
build
- Creates the field.
- Needs to be the last method added on the field object.
- (void) (Required)
Complete example ( Creation of a form field )
4) Add a submit field
Methods ( attributes )
-
field
- Field's type.
- (string) (Required)
-
label
- Field's label
- (string) (Optional) (work but useless)
-
value
- Field's value attribute
- (string) (Optional) (Default
''
)
-
id
- Form's id attribute.
- (string) (Optional)
-
class
- Form's classes as an array or string.
- (array | string ) (Optional)
attr
- Either a key-value pair array of custom attributes with their associated value.
- or a string for a single attribute without value
- (array) (Optional) (Default
[]
)
Action methods
build
- Creates the field.
- Needs to be the last method added on the field object.
- (void) (Required)
5) Close the form
More examples
select
form field
checkbox
form field
radio
form field
hidden
form field
Methods ( attributes )
-
field
- Field's type.
- (string) (Required)
-
name
- Field's name. Is Required since no label will be slugified.
- (string) (Optional)
-
value
- Field's value. Not required but would be brian to add it.
- (string) (Optional) (Default
''
)
-
id
- Form's id attribute.
- (string) (Optional)
-
class
- Form's classes as an array or string.
- (array | string ) (Optional)
-
attr
- Either a key-value pair array of custom attributes with their associated value.
- or a string for a single attribute without value
- (array) (Optional) (Default
[]
)
label
- Field's label. Work but useless.
- (string) (Optional)
Action methods
build
- Creates the field.
- Needs to be the last method added on the field object.
- (void) (Required)
All versions of simple-php-form-builder with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.4
The package jayrchamp/simple-php-form-builder contains the following files
Loading the files please wait ....