-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #95 from creative-commoners/pulls/6.0/cms5-readme
DOC Update README.md for CMS 5
- Loading branch information
Showing
1 changed file
with
9 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,11 +3,6 @@ | |
[![CI](https://github.com/symbiote/silverstripe-multivaluefield/actions/workflows/ci.yml/badge.svg)](https://github.com/symbiote/silverstripe-multivaluefield/actions/workflows/ci.yml) | ||
[![Silverstripe supported module](https://img.shields.io/badge/silverstripe-supported-0071C4.svg)](https://www.silverstripe.org/software/addons/silverstripe-commercially-supported-module-list/) | ||
|
||
Notes: | ||
|
||
* The Silverstripe 2.4 compatible version of the module is still available in the ss24 branch | ||
* The Silverstripe 3.x compatible versions are still available in the 2.x branches. (see version info) | ||
|
||
A database field type that allows the storage of multiple discrete values in | ||
a single database field. This also provides form fields for entering multiple | ||
values in a simple manner | ||
|
@@ -26,28 +21,20 @@ Data is stored in the database in a serialized PHP format. While this is not | |
ideal for searching purposes, some external indexing engines (eg the Solr | ||
module) are aware of the field type and will index accordingly. | ||
|
||
## Version info | ||
|
||
This version of MultiValueField supports Silverstripe 4.0.0 | ||
|
||
Older versions of Silverstripe are supported on minor version branches below | ||
|
||
* [Silverstripe 3.1+ compatible version](https://github.com/symbiote/silverstripe-multivaluefield/tree/2.4) | ||
|
||
## Installation | ||
|
||
``` | ||
```sh | ||
composer require symbiote/silverstripe-multivaluefield | ||
``` | ||
|
||
## Basic Usage | ||
|
||
As with all DB fields | ||
|
||
``` | ||
private static $db = array( | ||
'Keywords' => 'MultiValueField', | ||
); | ||
```php | ||
private static $db = [ | ||
'Keywords' => 'MultiValueField', | ||
]; | ||
``` | ||
|
||
To make use of the field on the frontend, you can loop over the Items property | ||
|
@@ -63,7 +50,8 @@ In this case, `$Value` is a Varchar object, so you can call all relevant string | |
Note that to have the `$Key` value available as something other than an integer, use the `KeyValueField` field type to populate the field. | ||
|
||
You can set the key and value placeholder values of the KeyValueField in your field like this: | ||
``` | ||
|
||
```php | ||
$kvf = KeyValueField::create( | ||
'MultiChoiceAnswer', | ||
'Multiple Choice Answers' | ||
|
@@ -76,10 +64,6 @@ $kvf->setKeyFieldPlaceholder('Label'); | |
|
||
* Marcus Nyeholt <[email protected]> | ||
|
||
## Requirements | ||
|
||
* Silverstripe 4.0 | ||
|
||
## Contributing | ||
|
||
### Thanks | ||
|
@@ -91,11 +75,11 @@ $kvf->setKeyFieldPlaceholder('Label'); | |
|
||
Translations of the natural language strings are managed through a third party translation interface, transifex.com. Newly added strings will be periodically uploaded there for translation, and any new translations will be merged back to the project source code. | ||
|
||
Please use [https://www.transifex.com/projects/p/silverstripe-multivaluefield](https://www.transifex.com/projects/p/silverstripe-multivaluefield) to contribute translations, rather than sending pull requests with YAML files. | ||
Please use [https://app.transifex.com/silverstripe/silverstripe-multivaluefield/](https://app.transifex.com/silverstripe/silverstripe-multivaluefield/) to contribute translations, rather than sending pull requests with YAML files. | ||
|
||
## License | ||
|
||
This module is licensed under the BSD license at http://silverstripe.org/BSD-license | ||
This module is licensed under the BSD license at https://silverstripe.org/BSD-license | ||
|
||
## Project Links | ||
* [GitHub Project Page](https://github.com/nyeholt/silverstripe-multivaluefield) | ||
|