KMP PHP API Reference

PagesController extends AppController
in package

Static content controller

This controller will render views from templates/Pages/

Tags
link
https://book.cakephp.org/4/en/controllers/pages-controller.html

Table of Contents

Constants

VIEW_DATA_EVENT  = 'KMP.plugins.callForViewData'
VIEW_PLUGIN_EVENT  = 'KMP.plugins.callForViewCells'

Properties

$isCsvRequest  : bool
$pluginViewCells  : array<string|int, mixed>

Methods

beforeFilter()  : Response|null|void
Run before controller action execution.
changelog()  : Response|null
Display the changelog page
display()  : Response|null
Displays a view
initialize()  : void
Load shared components: Authentication, Authorization, Flash.
isCsvRequest()  : bool
Check if current request is for CSV export.
switchView()  : Response
Switch between mobile and desktop view modes.
webmanifest()  : void
Render the PWA web manifest response.
authorizeCurrentUrl()  : void
Authorize the current URL/action via Authorization component.
organizeViewCells()  : array<string|int, mixed>
Organize view cells by type and display order.

Constants

VIEW_DATA_EVENT

public string VIEW_DATA_EVENT = 'KMP.plugins.callForViewData'

Event for plugin view data enhancement

VIEW_PLUGIN_EVENT

public string VIEW_PLUGIN_EVENT = 'KMP.plugins.callForViewCells'

Event for plugin view cell registration

Properties

$isCsvRequest

protected bool $isCsvRequest = false

Whether current request is for CSV export (.csv extension)

$pluginViewCells

protected array<string|int, mixed> $pluginViewCells = []

View cells from plugins for current request

Methods

beforeFilter()

Run before controller action execution.

public beforeFilter(EventInterface $event) : Response|null|void
Parameters
$event : EventInterface
Return values
Response|null|void

changelog()

Display the changelog page

public changelog() : Response|null

Reads the CHANGELOG.md file from the project root and renders it as HTML.

Return values
Response|null

display()

Displays a view

public display(string ...$path) : Response|null
Parameters
$path : string

Path segments.

Tags
throws
ForbiddenException

When a directory traversal attempt.

throws
MissingTemplateException

When the view file could not be found and in debug mode.

throws
NotFoundException

When the view file could not be found and not in debug mode.

throws
MissingTemplateException

In debug mode.

Return values
Response|null

initialize()

Load shared components: Authentication, Authorization, Flash.

public initialize() : void

isCsvRequest()

Check if current request is for CSV export.

public isCsvRequest() : bool
Return values
bool

switchView()

Switch between mobile and desktop view modes.

public switchView() : Response

Stores preference in session and redirects to appropriate interface. Mobile redirects to viewMobileCard, desktop to profile.

Return values
Response

Redirect response

webmanifest()

Render the PWA web manifest response.

public webmanifest() : void

authorizeCurrentUrl()

Authorize the current URL/action via Authorization component.

protected authorizeCurrentUrl() : void
Tags
throws
ForbiddenException

When authorization fails

organizeViewCells()

Organize view cells by type and display order.

protected organizeViewCells(array<string|int, mixed> $viewCells) : array<string|int, mixed>

Unused - view cells organized in ViewCellRegistry

Parameters
$viewCells : array<string|int, mixed>

Flat array of view cell configurations

Return values
array<string|int, mixed>

Organized array grouped by type and sorted by order


        
On this page

Search results