This field type represents keywords.
Name | Internal name | Expected input |
---|---|---|
Keyword | ezkeyword | string[]|string |
Table of contents:
This FieldType stores single or several keywords as comma separated keywords as a string or array of string keywords.
Type | Example |
---|---|
string | "documentation" |
string |
|
string[] | array( "eZ Systems", "Enterprise", "User Experience Management" ) |
The Value class of this field type contains the following properties:
Property | Type | Description |
---|---|---|
$value |
| Holds an array of keywords as strings. |
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" ); |
The Keyword
\Value
constructor will initialize a new Value object with the value provided.
It expects a list of keywords, either as comma separated in a string or as an array of strings.
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" ); |