You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
861 B
42 lines
861 B
<?php
|
|
|
|
/**
|
|
* Roles Routes
|
|
*/
|
|
return [
|
|
[
|
|
'pattern' => 'languages',
|
|
'method' => 'GET',
|
|
'action' => function () {
|
|
return $this->kirby()->languages();
|
|
}
|
|
],
|
|
[
|
|
'pattern' => 'languages',
|
|
'method' => 'POST',
|
|
'action' => function () {
|
|
return $this->kirby()->languages()->create($this->requestBody());
|
|
}
|
|
],
|
|
[
|
|
'pattern' => 'languages/(:any)',
|
|
'method' => 'GET',
|
|
'action' => function (string $code) {
|
|
return $this->kirby()->languages()->find($code);
|
|
}
|
|
],
|
|
[
|
|
'pattern' => 'languages/(:any)',
|
|
'method' => 'PATCH',
|
|
'action' => function (string $code) {
|
|
return $this->kirby()->languages()->find($code)?->update($this->requestBody());
|
|
}
|
|
],
|
|
[
|
|
'pattern' => 'languages/(:any)',
|
|
'method' => 'DELETE',
|
|
'action' => function (string $code) {
|
|
return $this->kirby()->languages()->find($code)?->delete();
|
|
}
|
|
]
|
|
];
|
|
|