Download the PHP package livecms/forms without Composer
On this page you can find all versions of the php package livecms/forms. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download livecms/forms
More information about livecms/forms
Files in livecms/forms
Package forms
Short Description Live CMS Forms
License MIT
Homepage https://github.com/livecms/forms
Informations about the package forms
Welcome to Laravel Form Component For Laravel 5.5 or above
What is ?
This package can make form component (ie. textbox, select, radio, checkbox) based on array of setting.
Besides that, You can also create your own component consist of html and javascript.
Features
- All benefits of LaravelCollective HTML packages
- Create form and the components based array of settings
- Support Jquery Validation
- Available Components that ready to use :
- Textbox
- Telephone
- Number
- Password
- Textarea
- Checkbox
- Radio
- Select
- Select2
- Image
- Boolean (Radio button with Yes/No options)
- Define your own component
- Define your own validation script
Notes
- You need add Jquery Validation to use default validation properly, but you can use your own script. See Custom Validation Section.
- Add Select2 Files if you want to use Select2 Component
How to use?
Install via composer
Publish config file :
Edit 'form.php' config file.
Creating form :
Set
in form :it has same arguments for Form::open() in LaravelCollective HTML
You can create multiple forms and set a name for each form :
Available components :
you can see the files in folder :
- Textbox, type : 'text'
- Telephone, type : 'tel'
- Number, type : 'number'
- Email, type : 'email'
- Password, type : 'password'
- Textarea, type : 'textarea'
- Checkbox, type : 'checkbox'
- Radio, type : 'radio'
- Select, type : 'select'
- Select2, type : 'select2'
- Image, type : 'image'
- Boolean, type : 'boolean'
How to use components :
Add global properties :
Add custom component :
-
Create a Class, you can extends a class from 'LiveCMS\Form\Components\BaseComponent' class in
Since it contains an abstract method render(), you have to define your own render() method. You can also see the example from available components or extends from it. See all files in folder
- Define your custome components in 'form' config file :
Use Validation Script
You can disable validation by :
Note : by default, validation script require jquery validation js
Custom Validation
- Create your own javascript file
- Define it in 'form' config file :
Add custom scripts
- Create your own javascript file
-
Define it in 'form' config file, but use other name despite 'validation' because it is reserved only for validation :
- Call it
If you want to cancel adding script, fill second argument with 'false':
Fill form with datas
LICENSE
MIT
CONTRIBUTING
Fork this repo and make a pull request
ISSUE AND DISCUSSION
Please create new issue or see the closed issues too.