$database->connect()
Connects to a database
$database->connect(array|null $params = null): PDO|null
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| $params | arrayornull |
null
|
This can either be a config key or an array of parameters for the connection |
Return types
PDOornull
This method modifies the existing $database object it is applied to and returns it again.
Exceptions
| Type | Description |
|---|---|
Kirby\Exception\InvalidArgumentException |