parent
764d9567e4
commit
37e65ce780
@ -0,0 +1,38 @@ |
|||||||
|
<?php |
||||||
|
// SPDX-License-Identifier: EUPL-1.2 |
||||||
|
// Authors: see README.md |
||||||
|
|
||||||
|
use SeaCMS\Api\JsonResponse; |
||||||
|
|
||||||
|
/** |
||||||
|
* A plugin for SeaCMS-app. |
||||||
|
*/ |
||||||
|
class SeacmsAppPlugin extends AbstractPicoPlugin |
||||||
|
{ |
||||||
|
/** |
||||||
|
* Pico API version. |
||||||
|
* @var int |
||||||
|
*/ |
||||||
|
const API_VERSION = 3; |
||||||
|
|
||||||
|
/** |
||||||
|
* return api routes |
||||||
|
* @return array |
||||||
|
*/ |
||||||
|
public function registerOnPageRenderedApiRoutes():array |
||||||
|
{ |
||||||
|
return [ |
||||||
|
'pages/(.*)/create' => 'createPage', // TODO only define for POST |
||||||
|
]; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* method to create a page |
||||||
|
* @return JsonResponse |
||||||
|
*/ |
||||||
|
public function createPage(string $pageName): JsonResponse |
||||||
|
{ |
||||||
|
return new JsonResponse(501,['code'=>501,'reason'=>"work in progress for '$pageName'"]); |
||||||
|
} |
||||||
|
|
||||||
|
} |
Loading…
Reference in new issue