class PageController (View source)

The Page controller.

Methods

static Response
add()

Add page based on data in $_POST.

static Response
data()

Send form when there is no posted data in the request or save data if there is.

static Response
delete()

Delete page.

static Response
duplicate()

Duplicate a page.

static Response
move()

Move a page.

static string
getTemplateNameFromArray(array|null $array = null, string|null $key = null)

Get the theme/template file from posted data or return a default template name.

static Response
save(Page $Page, string $url, array $data, string $prefix, string $slug)

Save a page.

Details

static Response add()

Add page based on data in $_POST.

Return Value

Response the response object

static Response data()

Send form when there is no posted data in the request or save data if there is.

Return Value

Response the response object

static Response delete()

Delete page.

Return Value

Response the response object

static Response duplicate()

Duplicate a page.

Return Value

Response the response object

static Response move()

Move a page.

Return Value

Response the response object

static private string getTemplateNameFromArray(array|null $array = null, string|null $key = null)

Get the theme/template file from posted data or return a default template name.

Parameters

array|null $array
string|null $key

Return Value

string The template filename

static private Response save(Page $Page, string $url, array $data, string $prefix, string $slug)

Save a page.

Parameters

Page $Page
string $url
array $data
string $prefix
string $slug

Return Value

Response the response object