SiteBase
in package
implements
ExtensionInterface
Plates template helper
Table of Contents
Interfaces
- ExtensionInterface
Properties
- $template : mixed
- $container : ContainerInterface
- $currentWebsite : Website|null
- $engine : Engine
Methods
- __construct() : mixed
- constructor
- assetUrl() : string
- gets asset url
- drawIcon() : void
- draws icon
- env() : mixed
- gets env variable
- getAdminSidebarVisibleLinks() : array<string|int, mixed>
- returns admin links for sidebar
- getCurrentLocale() : string|null
- gets current locale
- getCurrentUrl() : string
- getCurrentWebsite() : Website|null
- gets current website
- getCurrentWebsiteName() : string
- gets current website name
- getDarkModeSwitch() : string
- getDebugbar() : StandardDebugBar
- return debugger object
- getGravatar() : string
- gets gravatar html
- getObject() : self
- gets helper object
- getPageRegions() : array<string|int, mixed>
- returns page regions
- getQrCode() : string
- getUrl() : string
- gets route url by name and params
- register() : void
- {@inheritdoc}
- renderAdminTable() : string
- renderBlocks() : string
- render block for region
- renderFlashMessages() : void
- draws flash messages
- summarize() : string
- summarize text
- translate() : string
- gets string translations
- version() : string
- gets app version
- getApp() : App|null
- gets app object
- getAssets() : Manager
- gets assets manager object
- getHtmlRenderer() : HtmlPartsRenderer
- gets html parts renderer
- getSiteData() : SiteData
- gets site_data
- getUtils() : Globals
- gets utils
Properties
$template
public
mixed
$template
$container
protected
ContainerInterface
$container
$currentWebsite
protected
static Website|null
$currentWebsite
= null
current website cached element
$engine
protected
Engine
$engine
templates engine
Methods
__construct()
constructor
public
__construct(ContainerInterface $container) : mixed
Parameters
- $container : ContainerInterface
assetUrl()
gets asset url
public
assetUrl(string $asset_path) : string
Parameters
- $asset_path : string
Tags
Return values
stringdrawIcon()
draws icon
public
drawIcon(string $icon_name[, mixed $attributes = [] ][, mixed $translateSectionsName = false ]) : void
Parameters
- $icon_name : string
- $attributes : mixed = []
- $translateSectionsName : mixed = false
Tags
env()
gets env variable
public
env(string $variable[, null $default = null ]) : mixed
Parameters
- $variable : string
- $default : null = null
Tags
getAdminSidebarVisibleLinks()
returns admin links for sidebar
public
getAdminSidebarVisibleLinks(AdminPage $controller) : array<string|int, mixed>
Parameters
- $controller : AdminPage
Return values
array<string|int, mixed>getCurrentLocale()
gets current locale
public
getCurrentLocale() : string|null
Return values
string|nullgetCurrentUrl()
public
getCurrentUrl() : string
Return values
stringgetCurrentWebsite()
gets current website
public
getCurrentWebsite() : Website|null
Tags
Return values
Website|nullgetCurrentWebsiteName()
gets current website name
public
getCurrentWebsiteName() : string
Tags
Return values
stringgetDarkModeSwitch()
public
getDarkModeSwitch(AdminPage $controller) : string
Parameters
- $controller : AdminPage
Return values
stringgetDebugbar()
return debugger object
public
getDebugbar() : StandardDebugBar
Return values
StandardDebugBargetGravatar()
gets gravatar html
public
getGravatar(string $email[, int $s = 80 ][, string $d = 'mp' ][, string $r = 'g' ][, string $class = 'rounded-circle' ]) : string
Parameters
- $email : string
- $s : int = 80
- $d : string = 'mp'
- $r : string = 'g'
- $class : string = 'rounded-circle'
Return values
stringgetObject()
gets helper object
public
getObject() : self
Return values
selfgetPageRegions()
returns page regions
public
getPageRegions() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>getQrCode()
public
getQrCode(mixed $url) : string
Parameters
- $url : mixed
Return values
stringgetUrl()
gets route url by name and params
public
getUrl(string $route_name[, array<string|int, mixed> $route_params = [] ]) : string
Parameters
- $route_name : string
- $route_params : array<string|int, mixed> = []
Return values
stringregister()
{@inheritdoc}
public
register(Engine $engine) : void
Parameters
- $engine : Engine
-
[description]
renderAdminTable()
public
renderAdminTable(array<string|int, mixed> $elements[, array<string|int, mixed>|null $header = null ][, BasePage|null $current_page = null ]) : string
Parameters
- $elements : array<string|int, mixed>
- $header : array<string|int, mixed>|null = null
- $current_page : BasePage|null = null
Return values
stringrenderBlocks()
render block for region
public
renderBlocks(mixed $region, BasePage $controller) : string
Parameters
- $region : mixed
- $controller : BasePage
Tags
Return values
stringrenderFlashMessages()
draws flash messages
public
renderFlashMessages(BasePage $controller) : void
Parameters
- $controller : BasePage
Tags
summarize()
summarize text
public
summarize(string $text[, int $max_words = 10 ]) : string
Parameters
- $text : string
- $max_words : int = 10
Return values
stringtranslate()
gets string translations
public
translate(string $string[, array<string|int, mixed> $params = [] ]) : string
Parameters
- $string : string
- $params : array<string|int, mixed> = []
Tags
Return values
stringversion()
gets app version
public
version() : string
Return values
stringgetApp()
gets app object
protected
getApp() : App|null
Return values
App|nullgetAssets()
gets assets manager object
protected
getAssets() : Manager
Return values
ManagergetHtmlRenderer()
gets html parts renderer
protected
getHtmlRenderer() : HtmlPartsRenderer
Return values
HtmlPartsRenderergetSiteData()
gets site_data
protected
getSiteData() : SiteData
Return values
SiteDatagetUtils()
gets utils
protected
getUtils() : Globals