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.
39 lines
807 B
39 lines
807 B
<?php
|
|
// SPDX-License-Identifier: EUPL-1.2
|
|
// Authors: see README.md
|
|
|
|
use SeaCMS\Api\ApiAware;
|
|
use SeaCMS\Api\JsonResponse;
|
|
|
|
/**
|
|
* A plugin for SeaCMS-app.
|
|
*/
|
|
class SeacmsAppPlugin extends AbstractPicoPlugin implements ApiAware
|
|
{
|
|
/**
|
|
* 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'"]);
|
|
}
|
|
|
|
} |