Download the PHP package blackit/semantic-form without Composer
On this page you can find all versions of the php package blackit/semantic-form. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download blackit/semantic-form
More information about blackit/semantic-form
Files in blackit/semantic-form
Package semantic-form
Short Description Semantic UI form helpers
License MIT
Homepage https://github.com/blackit/semantic-form
Informations about the package semantic-form
Semantic Form
Semantic UI form builder, for Laravel.
Installation
API
Note: You can use either facade Form::method()
or helper form()->method()
.
Opening Form
Opening Form (Short Syntax, Since 1.10)
CSRF Token
CSRF token will automatically generated if current form method is POST
. To prevent token generation,
you can call withoutToken()
when opening a form.
Input Text
Password
Textarea
Select Box (Dropdown)
Select Date & Date Time
By default, selectDate and selectDateTime will post request as _myDate
with ['date'=>4, 'month'=>5, 'year'=>2016]
for example.
To get 2016-5-4
format, you need to register middleware and use it in the routes.
Select Range
Select Month
Radio
Radio Group
Checkbox
Checkbox Group
File
Input Wrapper
Reference: http://semantic-ui.com/elements/input.html
Image (Not Yet Implemented)
Datepicker (experimental)
See https://github.com/Semantic-Org/Semantic-UI/pull/3256 for further discussion. Remember, you must include calendar.js and calendar.css on your own.
Hidden
Button
Submit
Model Binding
Version 1
Version 2
Warning
Macro
Macro definition, put it anywhere within your application, e.g. AppServiceProvider:
And then call it like any other method:
Action
General Function
For every form element, you can call and chaining following methods:
- id($string)
- addClass($string)
- removeClass($string)
- attribute($name, $value)
- data($name, $value)
- hint($text) (Since 1.10.0)
- hint($text, $class = "hint") (Since 1.10.2)
Override Hint class globally (Since 1.10.2)
Example
Middleware
- \BlackIT\SemanticForm\Middleware\SelectDateMiddleware
- \BlackIT\SemanticForm\Middleware\SelectDateTimeMiddleware
Credits
SemanticForm inspired by AdamWathan\Form.
All versions of semantic-form with dependencies
illuminate/support Version ~5.6
nesbot/carbon Version ^1.36
jenssegers/date Version ^3.4