Skip to content

Kirby 5.0.4

$api->parent()

Returns the model's object for the given path

$api->parent(string $path): Kirby\Cms\ModelWithContent|null

Parameters

Name Type Default Description
$pathrequired string no default value Path to parent model

Return types

Kirby\Cms\ModelWithContentornull

This method modifies the existing $api object it is applied to and returns it again.

Exceptions

Type Description
Kirby\Exception\InvalidArgumentException if the model type is invalid
Kirby\Exception\NotFoundException if the model cannot be found

Parent class

Kirby\Cms\Api