AdminLayoutHttpControllerResponse
extends HttpControllerResponse
in package
Class AdminLayoutHttpControllerResponse
This class will be used for rendering the new Admin pages which must be explicitly written in templates. These templates can extend any of the existing admin layouts by themselves.
Child controllers can you the "init" method to initialize their dependencies
Tags
Table of Contents
- $assets : AssetCollectionInterface
- Page Assets
- $contentNavigation : ContentNavigationCollectionInterface
- Content Sub Navigation
- $contentView : ContentView
- ContentView instance.
- $data : KeyValueCollection
- Template data.
- $httpBody : string
- $httpHeadersArray : array<string|int, mixed>
- $template : string
- Template Path
- $title : string
- Page Title
- $textManager : TextManager
- TextManager service
- __construct() : mixed
- AdminLayoutHttpViewController constructor.
- createAsLegacyAdminPageResponse() : AdminLayoutHttpControllerResponse
- getBody() : string
- Returns the response body string.
- getHeaders() : array<string|int, mixed>
- Returns the response headers array.
- _render() : void
- Render the provided template.
- setInitialMessages() : void
- Set initial messages for new admin layout.
- assignData() : void
- Assigns content data from internal variables.
- configureContentView() : void
- Content view configuration.
- connectPage() : void
- Connects a page to the menu.
- createApplication() : Application
- Creates and boots an application instance.
- fixTranslations() : void
- Fix translations, so all translations from internal assets variable will be assigned too.
- getDeleteInstallerFolderMessage() : string
- Gets the "delete installer folder" message
- getSecurityToken() : string|null
- Gets the APP_SECURITY_TOKEN from the env
- getTextManager() : TextManager
- Gets the TextManager class instance
- loadGambioAdmin() : void
- Loads gambio admin layout data.
Properties
$assets
Page Assets
protected
AssetCollectionInterface
$assets
Provide paths or filenames to JavaScript, CSS or PHP Translation files.
$contentNavigation
Content Sub Navigation
protected
ContentNavigationCollectionInterface
$contentNavigation
The sub navigation will be displayed under the header and can redirect to similar pages.
$contentView
ContentView instance.
protected
ContentView
$contentView
Used for parsing the Smarty templates.
$data
Template data.
protected
KeyValueCollection
$data
$httpBody
protected
string
$httpBody
$httpHeadersArray
protected
array<string|int, mixed>
$httpHeadersArray
= []
$template
Template Path
protected
string
$template
$title
Page Title
protected
string
$title
$textManager
TextManager service
private
TextManager
$textManager
Used to get translated texts
Methods
__construct()
AdminLayoutHttpViewController constructor.
public
__construct(NonEmptyStringType $title, ExistingFile $template[, KeyValueCollection|null $data = null ][, AssetCollectionInterface|null $assets = null ][, ContentNavigationCollectionInterface|null $contentNavigation = null ][, ContentView|null $contentView = null ]) : mixed
Parameters
- $title : NonEmptyStringType
-
Page title.
- $template : ExistingFile
-
Template absolute path.
- $data : KeyValueCollection|null = null
-
A key-value collection containing the data to be used by the template.
- $assets : AssetCollectionInterface|null = null
-
Page assets (js, css, translations etc).
- $contentNavigation : ContentNavigationCollectionInterface|null = null
-
Sub content navigation (key-value collection).
- $contentView : ContentView|null = null
-
Provide a custom content view class if needed.
Return values
mixed —createAsLegacyAdminPageResponse()
public
static createAsLegacyAdminPageResponse(string $title, string $template[, array<string|int, mixed> $templateData = [] ][, array<string|int, string> $assets = [] ][, array<string|int, mixed>|null $subNavItems = null ]) : AdminLayoutHttpControllerResponse
Parameters
- $title : string
- $template : string
- $templateData : array<string|int, mixed> = []
- $assets : array<string|int, string> = []
- $subNavItems : array<string|int, mixed>|null = null
Return values
AdminLayoutHttpControllerResponse —getBody()
Returns the response body string.
public
getBody() : string
Return values
string —getHeaders()
Returns the response headers array.
public
getHeaders() : array<string|int, mixed>
Return values
array<string|int, mixed> —_render()
Render the provided template.
protected
_render() : void
Hint: Override this method to change the rendering algorithm.
Return values
void —setInitialMessages()
Set initial messages for new admin layout.
protected
setInitialMessages() : void
Return values
void —assignData()
Assigns content data from internal variables.
private
assignData(GXSmarty $smarty) : void
Parameters
- $smarty : GXSmarty
Return values
void —configureContentView()
Content view configuration.
private
configureContentView() : void
Return values
void —connectPage()
Connects a page to the menu.
private
connectPage(Application $application) : void
Parameters
- $application : Application
Return values
void —createApplication()
Creates and boots an application instance.
private
createApplication() : Application
Return values
Application —fixTranslations()
Fix translations, so all translations from internal assets variable will be assigned too.
private
fixTranslations(Smarty $smarty) : void
Parameters
- $smarty : Smarty
Return values
void —getDeleteInstallerFolderMessage()
Gets the "delete installer folder" message
private
getDeleteInstallerFolderMessage() : string
Return values
string —getSecurityToken()
Gets the APP_SECURITY_TOKEN from the env
private
getSecurityToken() : string|null
Return values
string|null —getTextManager()
Gets the TextManager class instance
private
getTextManager() : TextManager
Return values
TextManager —loadGambioAdmin()
Loads gambio admin layout data.
private
loadGambioAdmin(Application $application, GXSmarty $smarty) : void
Parameters
- $application : Application
- $smarty : GXSmarty