$pageGuards->ensureToBeCreatable()
Checks if the page can be created before its content has been added. The full checks incl. the content validation run in the create action.
$pageGuards->ensureToBeCreatable(): void
Exceptions
| Type | Description |
|---|---|
Kirby\Exception\AbilityException |
If a listed or unlisted page cannot be published, e.g. the error page |
Kirby\Exception\DuplicateException |
If the same page or a draft already exists |
Kirby\Exception\InvalidArgumentException |
If the slug is invalid |
Kirby\Exception\PermissionException |
If the user is not allowed to create this page or to publish it |