Pagefile::addTag()
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 arrayUsage
$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
$thisObject instance it was called from (method supports fluent interface).
See Also
Pagefile methods and properties
API reference based on ProcessWire core version 3.0.252