TemplateExtender
in package
Class TemplateExtender
Tags
Table of Contents
- $componentsService : GXModulesComponentsService
- __construct() : mixed
- TemplateExtender constructor.
- extend() : string
- Extends the template with valid GxModules.
- isExtendingLayout() : bool
- Checks if $htmlFile should extend the whole layout.
- isExtendingPage() : bool
- Checks if $htmlFile should extend the page.
- isTemplate() : bool
- Simple check for equality of both arguments.
Properties
$componentsService
private
GXModulesComponentsService
$componentsService
Methods
__construct()
TemplateExtender constructor.
public
__construct(GXModulesComponentsService $componentsService) : mixed
Parameters
- $componentsService : GXModulesComponentsService
Return values
mixed —extend()
Extends the template with valid GxModules.
public
extend(string $template) : string
Parameters
- $template : string
Return values
string —isExtendingLayout()
Checks if $htmlFile should extend the whole layout.
private
isExtendingLayout(string $htmlFile) : bool
Any GxModules html file located in GxModules/Vendor/Module/Admin/Html/layout/ will be used to extend the layout.
Parameters
- $htmlFile : string
Return values
bool —isExtendingPage()
Checks if $htmlFile should extend the page.
private
isExtendingPage(string $relativeTemplatePath, string $htmlFile) : bool
So when the $htmlFile contains $relativeFilePath (case insensitive), the current page should be extended.
Example: $htmlFile = /path/shop/GxModules/Vendor/Module/Admin/Html/configuration/ui/configuration_page.html $relativeFilePath = Configuration/UI/configuration_page.html
The GxModules $htmlFile should extend the current page in this case.
Parameters
- $relativeTemplatePath : string
- $htmlFile : string
Return values
bool —isTemplate()
Simple check for equality of both arguments.
private
isTemplate(string $template, string $htmlFile) : bool
Parameters
- $template : string
- $htmlFile : string