MainController
Main controller for the admin panel.
Note this is a "shared" / singleton object: Middleware AdminPanelInitiator instantiates the object and eventually calls initialize(). Later, AdminPanelRenderer calls render() on the same object.
Attributes
- #[Autoconfigure]
- $public: true
Table of Contents
Properties
- $modules : array<string, ModuleInterface>
Methods
- __construct() : mixed
- initialize() : ServerRequestInterface
- Initializes settings for the admin panel.
- render() : string
- Renders the admin panel - Called in PSR-15 Middleware
- generateBackendUrl() : string
- Generate a url to a backend route
- getBackendUser() : BackendUserAuthentication
- initializeModules() : ServerRequestInterface
- storeDataPerModule() : ModuleDataStorageCollection
Properties
$modules
protected
array<string, ModuleInterface>
$modules
= []
Methods
__construct()
public
__construct(ModuleLoader $moduleLoader, UriBuilder $uriBuilder, RequestId $requestId, ViewFactoryInterface $viewFactory) : mixed
Parameters
- $moduleLoader : ModuleLoader
- $uriBuilder : UriBuilder
- $requestId : RequestId
- $viewFactory : ViewFactoryInterface
initialize()
Initializes settings for the admin panel.
public
initialize(ServerRequestInterface $request) : ServerRequestInterface
Parameters
- $request : ServerRequestInterface
Return values
ServerRequestInterfacerender()
Renders the admin panel - Called in PSR-15 Middleware
public
render(ServerRequestInterface $request) : string
Parameters
- $request : ServerRequestInterface
Tags
Return values
stringgenerateBackendUrl()
Generate a url to a backend route
protected
generateBackendUrl(string $route) : string
Parameters
- $route : string
Return values
stringgetBackendUser()
protected
getBackendUser() : BackendUserAuthentication
Return values
BackendUserAuthenticationinitializeModules()
protected
initializeModules(ServerRequestInterface $request, array<string, ModuleInterface> $modules) : ServerRequestInterface
Parameters
- $request : ServerRequestInterface
- $modules : array<string, ModuleInterface>
Return values
ServerRequestInterfacestoreDataPerModule()
protected
storeDataPerModule(ServerRequestInterface $request, array<string, ModuleInterface> $modules, ModuleDataStorageCollection $data) : ModuleDataStorageCollection
Parameters
- $request : ServerRequestInterface
- $modules : array<string, ModuleInterface>
- $data : ModuleDataStorageCollection