承接 symbiote/silverstripe-multivaluefield 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

symbiote/silverstripe-multivaluefield

最新稳定版本:7.0.0

Composer 安装命令:

composer require symbiote/silverstripe-multivaluefield

包简介

A DB field + form fields for storing multiple values in a single property (serialized).

README 文档

README

CI Silverstripe supported module

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

  • MultiValueTextField - displays a text field. When data is entered, another text field is displayed directly beneath. Subsequent data entry triggers more text fields to appear
  • MultiValueDropdownField - displays a dropdown field. When a value is selected another dropdown field is displayed.

Within templates, the field can be iterated over as per a data object set. The property $Value is available as a Varchar type, and other typical properties such as $FirstLast etc are inherited from ViewableData.

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

Installation

composer require symbiote/silverstripe-multivaluefield

Basic Usage

As with all DB fields

private static $db = array(
    'Keywords' 	=> 'MultiValueField',
);

To make use of the field on the frontend, you can loop over the Items property

<% loop $Keywords.Items %>
    <p>$Key $Value</p>
<% end_loop %>

In this case, $Value is a Varchar object, so you can call all relevant string field methods on it, such as $Value.Raw, $Value.LimitWordCount etc etc.

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:

$kvf = KeyValueField::create(
    'MultiChoiceAnswer',
    'Multiple Choice Answers'
);
$kvf->setValueFieldPlaceholder('Value');
$kvf->setKeyFieldPlaceholder('Label');

Maintainer Contacts

Requirements

  • Silverstripe 4.0

Contributing

Thanks

Translations

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 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

Project Links

统计信息

  • 总下载量: 421.5k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 47
  • 点击次数: 1
  • 依赖项目数: 59
  • 推荐数: 0

GitHub 信息

  • Stars: 47
  • Watchers: 9
  • Forks: 45
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2017-06-30