This class includes methods for generating and modifying page names.
While these methods are mosty for internal core use, some may at times be useful from the public API as well.
You can access methods from this class via the Pages API variable at $pages->names()
.
if($pages->names()->pageNameExists('something')) {
// A page named “something” exists
}
// generate a globally unique random page name
$name = $pages->names()->uniqueRandomPageName();
Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the Pages
class also inherits all the methods and properties of: Wire.
Manipulators
Name | Return | Summary | |
---|---|---|---|
Pages Pages Pages | string | If name exceeds maxLength, truncate it, while keeping any numbered suffixes in place | |
Pages Pages Pages | (nothing) | Check given page’s name for conflicts and increment as needed while also triggering a warning notice | |
Pages Pages Pages | string | Increment the suffix of a page name, or add one if not present | |
Pages Pages Pages | string | Assign a name to given Page (if it doesn’t already have one) |
Informational
Generators
Name | Return | Summary | |
---|---|---|---|
Pages Pages Pages | string | Create a page name from the given format | |
Pages Pages Pages | string | Get a unique page name | |
Pages Pages Pages | string | Get a random, globally unique page name |
Additional methods and properties
In addition to the methods and properties above, Pages
API reference based on ProcessWire core version 3.0.236