From fc7c4ae40f8e8229ec3fc151f9d114f3fa3cff31 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Wed, 19 Apr 2023 17:02:18 +1200 Subject: [PATCH] DOC Update README.md for CMS 5 --- README.md | 34 +++++++++------------------------- 1 file changed, 9 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 5cf0744..9c4b93a 100644 --- a/README.md +++ b/README.md @@ -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,17 +21,9 @@ 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 ``` @@ -44,10 +31,10 @@ composer require symbiote/silverstripe-multivaluefield 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 -## 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)