PageInitTrait
Loads the `AdminPage` entity (table `cms_admin_system_pages`) for the current presenter and action.
Like the Front PageInitTrait, the model goes through
the API bridge (AdminPageManager to api/system/admin-page), not directly through
the entity manager. Admin has no slug in the URL, so the page is found by the pair presenter
and action. The presenter column holds the full Nette name with a leading colon
(:Admin:System:Page), so : is prefixed to Presenter::getName(),
which returns Admin:System:Page.
When the row does not exist (or an error occurs), adminPageEntity stays null and admin keeps working.
The include menuItemRels.adminMenuItem carries the link to the admin menu item
(cms_admin_system_page_menu_item_relations); through it
Menu knows which item to highlight even
in the add/edit/del actions that have no menu item of their own. Without the nested
.adminMenuItem part the relation rows arrive with an empty item (the relation has no
scalar id column).
Table of Contents
Properties
Methods
- getAdminPageEntity() : AdminPage|null
- initializeMetaTags() : void
- Fills the template with the title, meta tags and HTML text of the page from the translation (`PageText`) of the current language, for the layout (like the Front {@see \App\Core\Traits\Front\Presenters\PageInitTrait}).
- initializePage() : void
Properties
$adminPageManager
public
AdminPageManager
$adminPageManager
Attributes
- #[Inject]
$adminPageEntity
protected
AdminPage|null
$adminPageEntity
= null
Methods
getAdminPageEntity()
public
getAdminPageEntity() : AdminPage|null
Return values
AdminPage|nullinitializeMetaTags()
Fills the template with the title, meta tags and HTML text of the page from the translation (`PageText`) of the current language, for the layout (like the Front {@see \App\Core\Traits\Front\Presenters\PageInitTrait}).
private
initializeMetaTags(AdminPage|null $adminPageEntity) : void
When the page or translation is missing, the values are empty strings and the layout uses its fallbacks.
Parameters
- $adminPageEntity : AdminPage|null
initializePage()
private
initializePage() : void