Skip to content
This repository has been archived by the owner on Feb 11, 2023. It is now read-only.

Commit

Permalink
Update docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
lakiboy committed Sep 25, 2017
1 parent 30535ea commit f1dd26b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 27 deletions.
4 changes: 0 additions & 4 deletions Resources/doc/choices.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# Choices

## Demo

For a reference, please, check out this [demo](http://forms.devmachine.net/choices/).

## Javascript

There are no external Javascript dependencies.
9 changes: 2 additions & 7 deletions Resources/doc/date.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# Bootstrap date

## Demo

For quick reference, please, check out this [demo](http://forms.devmachine.net/).

## Javascript

This form type integrates _Bootstrap_ date _Javascript_ library. Read the documentation [here](http://bootstrap-datepicker.readthedocs.org/).
Expand All @@ -17,7 +13,7 @@ devmachine_form:
formats:
date: dd/MM/y # default value: yyyy-MM-dd
```

Read [more](http://userguide.icu-project.org/formatparse/datetime) about _ICU_ formats.

## Installation with Assetic
Expand All @@ -38,7 +34,7 @@ assetic:
- lib/bootstrap-datepicker/js/bootstrap-datepicker.js
```

It is not necessary to use _Assetic_ library. Just make sure relevant _Javascript_ is availbale before `form_javascript` twig block is called. See the [demo](https://github.com/dev-machine/forms-demo) for reference.
It is not necessary to use _Assetic_ library. Just make sure relevant _Javascript_ is availbale before `form_javascript` twig block is called.

## Form options

Expand All @@ -59,4 +55,3 @@ $builder->add('field', DateType::class, [
```

See the full list of _Javascript_ [config options](http://bootstrap-datepicker.readthedocs.org/en/latest/options.html).

6 changes: 1 addition & 5 deletions Resources/doc/datetime.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# Bootstrap datetime

## Demo

For quick reference, please, check out this [demo](http://forms.devmachine.net/bootstrap-datetime/).

## Javascript

This form type integrates _Bootstrap_ datetime _Javascript_ library. Read the documentation [here](http://eonasdan.github.io/bootstrap-datetimepicker/).
Expand Down Expand Up @@ -39,7 +35,7 @@ assetic:
- lib/eonasdan-bootstrap-datetimepicker/js/bootstrap-datetimepicker.js
```

It is not necessary to use _Assetic_ library. Just make sure relevant _Javascript_ is availbale before `form_javascript` twig block is called. See the [demo](https://github.com/dev-machine/forms-demo) for reference.
It is not necessary to use _Assetic_ library. Just make sure relevant _Javascript_ is availbale before `form_javascript` twig block is called.

## Form options

Expand Down
16 changes: 5 additions & 11 deletions Resources/doc/typeahead.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# Twitter typeahead

## Demo

For quick reference, please, check out this [demo](http://forms.devmachine.net/typeahead/).

## Javascript

This form type integrates _Twitter_ typeahead _Javascript_ library. Read the documentation [here](https://github.com/twitter/typeahead.js/blob/master/doc/jquery_typeahead.md).
Expand All @@ -25,7 +21,7 @@ assetic:
- lib/typeahead.js/typeahead.bundle.js
```

It is not necessary to use _Assetic_ library. Just make sure relevant _Javascript_ is availbale before `form_javascript` twig block is called. See the [demo](https://github.com/dev-machine/forms-demo) for reference.
It is not necessary to use _Assetic_ library. Just make sure relevant _Javascript_ is availbale before `form_javascript` twig block is called.

## Form options

Expand All @@ -42,21 +38,19 @@ $builder->add('movie', TypeaheadType::class, [
'highlight' => true, // Pattern matches for the current query in text.
'min_length' => 3, // The min length needed before suggestions start getting rendered.
'class_names' => [], // https://github.com/twitter/typeahead.js/blob/master/doc/jquery_typeahead.md#class-names

// https://github.com/twitter/typeahead.js/blob/master/doc/jquery_typeahead.md#datasets
'source' => [], // Data set: array of values or array of hashes, empty for Ajax typeaheads.
'limit' => 5, // Limit amount of results.
'value_key' => null, // Hash key of data source item to be used as suggestion value.
'label_key' => null, // Hash key of data source item to be used as suggestion label.
'matcher' => 'contains', // Allowed values: contains, starts_with, ends_with

'route_name' => null, // Route name for Ajax typeaheads.
'route_params' => [], // Route params for Ajax typeaheads.
])
```

At the moment only single data source is suppored.

There are 2 predefined typeaheads: [TypeaheadTimezoneType](https://github.com/lakiboy/devmachine-form-bundle/blob/master/Form/Type/TypeaheadTimezoneType.php) and [TypeaheadCountryType](https://github.com/lakiboy/devmachine-form-bundle/blob/master/Form/Type/TypeaheadCountryType.php). Both form types are good examples for non-Ajax suggestions.
At the moment only single data source is suppored.

Check the [demo](http://forms.devmachine.net/typeahead/) for Ajax typeahead example.
There are 2 predefined typeaheads: [TypeaheadTimezoneType](https://github.com/lakiboy/devmachine-form-bundle/blob/master/Form/Type/TypeaheadTimezoneType.php) and [TypeaheadCountryType](https://github.com/lakiboy/devmachine-form-bundle/blob/master/Form/Type/TypeaheadCountryType.php). Both form types are good examples for non-Ajax suggestions.

0 comments on commit f1dd26b

Please sign in to comment.