Versions Compared
compared with
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Comment:
layout change
This Field Type represents keywords.
Name | Internal name | Expected input |
---|---|---|
Keyword | ezkeyword | string[]|string |
Table of contents:
Table of Contents | ||
---|---|---|
|
Description
This Field Type stores one or several comma-separated keywords as a string or array of strings.
Input expectations
Type | Example |
---|---|
string | "documentation" |
string |
|
string[] | array( "eZ Systems", "Enterprise", "User Experience Management" ) |
Value object
Properties
The Value class of this Field Type contains the following properties:
Property | Type | Description |
---|---|---|
$value |
| Holds an array of keywords as strings. |
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
use eZ\Publish\Core\FieldType\Keyword\Value;
// Instantiates a Value object
$keywordValue = new Value();
// Sets an array of keywords as a value
$keyword->value = array( "php", "css3", "html5", "eZ Publish" ); |
Constructor
The Keyword
\Value
constructor will initialize a new Value object with the value provided.
It expects a list of keywords, either comma-separated in a string or as an array of strings.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
use eZ\Publish\Core\FieldType\Keyword\Value;
// Instantiates a Value object with an array of keywords
$keywordValue = new Value( array( "php5", "css3", "html5" ) );
// Instantiates a Value object with a list of keywords in a string
// This is equivalent to the example above
$keywordValue = new Value( "php5,css3,html5" ); |