Download the PHP package mvanvu/php-form without Composer
On this page you can find all versions of the php package mvanvu/php-form. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mvanvu/php-form
More information about mvanvu/php-form
Files in mvanvu/php-form
Package php-form
Short Description Php Form package
License MIT
Homepage https://github.com/mvanvu/php-form
Informations about the package php-form
Php Form Package
Manage the form fields in easy way, security and cool.
Features
- Render form via templates: Bootstrap (v3 and v4) and Uikit v3
- Ability to add new custom fields
- Ability to add new custom rules (for validation)
- Ability to translate the field
- Cool feature show/hide on
- Create once and using to render HTML form and validate from the PHP server
Included dependencies
- Php-registry (see https://github.com/mvanvu/php-registry)
- Php-filters (see https://github.com/mvanvu/php-filter)
Installation via Composer
Alternatively, from the command line:
Testing
1 - Clone this repo:
git clone https://github.com/mvanvu/php-form.git
2 - Go to the repo
cd php-from
3 - Composer install
composer install
4 - Run test server
php -S localhost:9000/tests
5 - Open the browser with url localhost:9000/tests
Usage
Forms manager
Using the forms manager to manage all your forms
Consider using the form with name
Translate the field (for multilingual purpose, include php-form.min.css & php-form.min.js)
Default fields see at path src/Field
- Switcher (must include assets/css/php-form.min.css if you don't use the php-assets)
- Check
- CheckList
- Hidden
- Number
- Password
- Radio
- Select
- SubForm
- Text
- TextArea
SubForm field
Display a group fields width in the grid columns layout
Show on feature
Show or hide the base field in the conditions (UI likes the Joomla! CMS Form)
Show on values
Format: {fieldName}:{markup}
- {fieldName} = the name of field
- {markup} = the format of {fieldName} value
For eg: the {fieldName} = MyField
Show when MyField is empty
showOn => 'MyField:'
Show when MyField is not empty
showOn => 'MyField:!'
Show when MyField min length is 5
showOn => 'MyField:>=5'
Show when MyField max length is 15
showOn => 'MyField:<=15'
Show when MyField value is 12345
showOn => 'MyField:12345'
Show when MyField value is not 12345
showOn => 'MyField:!12345'
Show when MyField value in 12345 or abcxyz
showOn => 'MyField:12345,abcxyz'
Show when MyField value not in 12345 or abcxyz
showOn => 'MyField:!12345,abcxyz'
AND Operator (&)
Show when MyField not empty and MyField value is abc123
showOn => 'MyField:! & MyField:abc123'
OR Operator (|)
Show when MyField not empty or MyField value is abc123
showOn => 'MyField:! | MyField:abc123'
Filters
This is A Php Filters native. Just use the filters attributes (String or Array) like the Php Filters (see https://github.com/mvanvu/php-filter)
Default Validations (see at path src/Rule)
Confirm
Date
Check the value is a valid date
MinLength and MaxLength
Options
Regex
Custom function
Extends Field and Rule
Create all your fields at src/Field, the field must be extended \MaiVu\Php\Form\Field class
AND
Create all your rules at src/Rule, the rule must be extended \MaiVu\Php\Form\Rule class
OR
if you want to use your custom namespace
Then create your FieldClass in your namespace
Create your RuleClass in your namespace
All versions of php-form with dependencies
mvanvu/php-registry Version ~1.0
ext-json Version *
ext-mbstring Version *