MMOframework
Pourquoi l'IA Playground Bibliothèques Documentation Rechercher Agence
FR EN
Index

tAdminApi

MMO\editor\controllers · 1 symbole · générée le 27 Oct 2026

trait

tAdminApi

tAdminApi.php:16

What the backoffice's apis share (PagesController, SectionTypesController): a logged-in user, the session's CSRF token for what changes something -- one token for both, PagesController::Token --, a json body, a 422 that says what is wrong field by field, and an error that says why in meta.error.

trait MMO\editor\controllers\tAdminApi
Espace de noms
MMO\editor\controllers

Index

body($route)
checkToken($route)Make sure a request changing something comes from a page of the site: it has the session's token, or is authenticated by an Authorization header (which a browser does not send on its own)
explainErrors($route)An error says why in the answer's body too (meta.error): http/2 has no status text to carry it
invalid($route, $e)
setStatus($route, $status)
user($route)

Méthodes6

body($route)

tAdminApi.php:52
protected function body(MMO\core\server\Route $route): array
$routeRoute
retournearraymixed> the body of the request, a json object

checkToken($route)

tAdminApi.php:42

Make sure a request changing something comes from a page of the site: it has the session's token, or is authenticated by an Authorization header (which a browser does not send on its own)

protected function checkToken(MMO\core\server\Route $route): void
$routeRoute
retournevoid
lève(403) if it has not

explainErrors($route)

tAdminApi.php:18

An error says why in the answer's body too (meta.error): http/2 has no status text to carry it

protected function explainErrors(MMO\core\server\Route $route): void
$routeRoute
retournevoid

invalid($route, $e)

tAdminApi.php:59
protected function invalid(MMO\core\server\Route $route, MMO\editor\exceptions\eInvalidPage $e): array
$routeRoute
$eeInvalidPage
retournearrayarray<string, string>} a 422 saying what is wrong

setStatus($route, $status)

tAdminApi.php:64
protected function setStatus(MMO\core\server\Route $route, int $status): void
$routeRoute
$statusint
retournevoid

user($route)

tAdminApi.php:31
protected function user(MMO\core\server\Route $route): MMO\oauth\interfaces\iClient
$routeRoute
retourneiClientthe logged-in user
lève(401) if nobody is