Add the given tag to this file’s tags (if not already present)
Available since version 3.0.17.
Example
$file = $page->files->first();
$file->addTag('foo'); // add single tag
$file->addTag('foo,bar,baz'); // add multiple tags
$file->addTag(['foo', 'bar', 'baz']); // same as above, using array
Usage
$pagefile->addTag($tag);
Arguments
Name | Type(s) | Description |
---|---|---|
tag | string, array | Tag to add, or array of tags to add, or CSV string of tags to add. |
Return value
$this
Object instance it was called from (method supports fluent interface).
See Also
Pagefile methods and properties
API reference based on ProcessWire core version 3.0.236