https://github.com/openclassify/list-field_type
https://github.com/openclassify/list-field_type
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/openclassify/list-field_type
- Owner: openclassify
- Created: 2020-05-21T15:36:55.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-05-27T12:17:06.000Z (over 5 years ago)
- Last Synced: 2024-04-14T04:21:00.025Z (almost 2 years ago)
- Language: PHP
- Size: 12.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# README #
### What is this repository for? ###
A simple list field-type for Pyrocms 3 that allows you to add dynamic lists to items without end users breaking the layout.
Reorder, Add more lines, remove them
### How do I use this? ###
Returns an array of values
{{ visiosoft.field_type.list.values }}
Returns the number of list items
{{ visiosoft.field_type.list.count }}
# Configuration
Below is the full configuration available with defaults.
protected $fields = [
"example" => [
"type" => "emange.field_type.list",
"config" => [
"min" => null,
"max" => null
]
]
];
### Default Value
"default_type" => "text"
The `default_value` allows you to set the input type for validation. Supports text and email.
# Usage
## Setting Values
You must set the list field type value with a value or values from the available options.
$entry->example = "foo";
You can set multiple values with an array.
$entry->example = ["foo", "bar"];
The list field type returns an array of values.
$entry->example->values; // ["foo", "bar"];