Pagefile::tags()
Get or set the "tags" property, when in use.
Example
$file = $page->files->first();
$tags = $file->tags(); // Get tags string
$tags = $file->tags(true); // Get tags array
$file->tags("foo bar baz"); // Set tags to be these 3 tags
$tags->tags(["foo", "bar", "baz"]); // Same as above, using arrayUsage
// basic usage
$string = $pagefile->tags();
// usage with all arguments
$string = $pagefile->tags($value = null);Arguments
| Name | Type(s) | Description |
|---|---|---|
$value (optional) | bool string array | Specify one of the following:
|
Return value
string arrayReturns the current tags as a string or an array. When an array is returned, it is an associative array where the key and value are both the tag (keys are always lowercase).
See Also
Pagefile methods and properties
API reference based on ProcessWire core version 3.0.253