$api->model()
Returns an API model instance by name
$api->model(string|null $name = null, $object = null): Kirby\Api\Model
Parameters
| Name | Type | Default |
|---|---|---|
| $name | stringornull |
null
|
| $object | mixed |
null
|
Return type
This method modifies the existing $api object it is applied to and returns it again.
Exceptions
| Type | Description |
|---|---|
Kirby\Exception\NotFoundException |
If no model for $name exists |
Parent class
Kirby\Cms\Api
inherited from Kirby\Api\Api