Page
extends BaseComponent
in package
implements
HtmlPageInterface
Uses
Options, Properties, IndexPage, UiLibrary, IncludeOption
Html page
Table of Contents
Interfaces
- HtmlPageInterface
- Extension interface
Constants
- APPLICATION_ERROR_PAGE = 'application-error'
- NAME_SEPARATORS = ['::' => \Arikaim\Core\Interfaces\View\ComponentInterface::EXTENSION_COMPONENT, '>' => \Arikaim\Core\Interfaces\View\ComponentInterface::PRIMARY_TEMLATE, ':' => \Arikaim\Core\Interfaces\View\ComponentInterface::TEMPLATE_COMPONENT, '~' => \Arikaim\Core\Interfaces\View\ComponentInterface::COMPONENTS_LIBRARY]
- PAGE_NOT_FOUND = 'page-not-found'
- Error page names
- SYSTEM_ERROR_PAGE = 'system-error'
- SYSTEM_TEMPLATE_NAME = 'system'
- Control panel template name
Properties
- $id : string|null
- Component Id
- $basePath : string
- Base path
- $componentInstances : array<string|int, mixed>
- Component instances list
- $componentsFiles : array<string|int, mixed>
- Component include files (js)
- $componentType : string
- Component type
- $context : array<string|int, mixed>
- Component context used in render
- $data : array<string|int, mixed>
- Component data file content
- $error : string|null
- Component error code
- $extensionsPath : string
- Extensions path
- $filePath : string
- File path
- $files : array<string|int, mixed>
- Component files
- $fullName : string
- Component full name
- $fullPath : string
- Component full path
- $hasHtmlContent : mixed
- Return true if compoent has html file
- $htmlCode : string
- Html code
- $htmlFileName : string|null
- Html file name
- $includedComponents : array<string|int, mixed>
- Included compoents
- $language : string
- Language code
- $languages : array<string|int, mixed>
- Page languages
- $libraryOptions : array<string|int, mixed>
- Ui Library options
- $location : int
- Component Location
- $name : string
- Component name
- $options : array<string|int, mixed>
- Options
- $optionsFile : string
- Optins file
- $parent : array<string|int, mixed>
- Parent component info
- $path : string
- Component path
- $primaryTemplate : string
- Primary template name
- $properties : array<string|int, mixed>
- Properies
- $removeIncludeOptions : bool
- Remove include options
- $renderMode : int
- Render mode
- $styles : array<string|int, mixed>
- Component styles file content
- $templateName : string
- Template, extension or components library name
- $templatePath : string|null
- Template path
- $templateUrl : string
- Template url
- $url : string
- Component url
- $view : ViewInterface
- View
- $viewPath : string
- View path
- $defaultLanguage : string
- Default language
- $head : PageHead|null
- Page head properties
Methods
- __construct() : mixed
- Constructor
- addComponentFile() : mixed
- Add component file
- addComponentInstance() : void
- Add component instance
- addFile() : void
- Add file
- addIncludedComponent() : void
- Add included component
- clearContent() : void
- Clear content
- create() : ComponentInterface
- Create component
- getBasePath() : string
- Return base path
- getComponentFile() : string|false
- Get component file
- getComponentFullPath() : string
- Get component full path
- getComponentInstances() : array<string|int, mixed>
- Get components include files
- getComponentsFiles() : array<string|int, mixed>
- Get components include files
- getComponentType() : string
- Get component type
- getContext() : array<string|int, mixed>
- Get context
- getCurrentTemplate() : string
- Get current template name
- getError() : string|null
- Get error
- getFiles() : array<string|int, mixed>
- Return files
- getFileUrl() : string
- Convert file path to url
- getFullName() : string
- Get component full name
- getFullPath() : string
- Get full path
- getFullUrl() : string
- Get full page url
- getHtmlCode() : string
- Get html code
- getIncludedComponents() : array<string|int, mixed>
- Get included components
- getIncludeFile() : string|null
- Get include file url
- getIndexFile() : string
- Get page index file
- getLanguage() : string
- Get language
- getLanguages() : array<string|int, mixed>
- Get languages
- getLibraryDetails() : array<string|int, mixed>
- Get library details
- getLibraryFiles() : array<string|int, mixed>
- Get library files
- getLibraryIncludeFiles() : array<string|int, mixed>
- Get include library files
- getLibraryProperties() : array<string|int, mixed>
- Return library properties
- getLocation() : int
- Get location
- getName() : string
- Get component name
- getOption() : mixed
- Get option
- getOptions() : array<string|int, mixed>
- Get options
- getPath() : string
- Get path
- getPrimaryTemplate() : string
- Get primary template
- getProperties() : array<string|int, mixed>
- Get properties
- getPropertiesFileName() : string|null
- Get properties file name
- getRenderMode() : int
- Undocumented function
- getRootPath() : string
- Get root componetn path
- getTemplateFile() : string
- Get template file
- getTemplateName() : string
- Get template or extension name
- getTemplatePath() : string
- Get template path
- getTemplateUrl() : string
- Get template url
- getUrl() : string
- Return url link with current language code
- hasContent() : bool
- Return true if component have html content
- hasError() : bool
- Return true if have error
- hasFiles() : bool
- Return true if component have files
- hasParent() : bool
- Return true if component has child
- hasProperties() : bool
- Return true if component have properties
- head() : PageHead
- Get head properties
- init() : void
- Init component
- isIncludedComponent() : mixed
- isValid() : bool
- Return true if component is valid
- loadOptions() : void
- Load options json file
- loadProperties() : void
- Load properties json file
- mergeContext() : void
- Merge context
- mergeData() : void
- Add data to context array
- mergeProperties() : void
- Add properties to context array
- mergeRecursiveContext() : void
- Merge recursive context
- mergeStyles() : void
- Add styles to context array
- parseLibraryName() : array<string|int, mixed>
- Parse library name (name:version)
- render() : ComponentInterface
- Render page
- renderApplicationError() : ComponentInterface
- Render application error
- renderHtmlComponent() : HtmlComponentInterface
- Render html component
- renderPageNotFound() : ComponentInterface
- Render page not found
- renderSystemError() : ComponentInterface
- Render system error(s)
- resolve() : bool
- Render component data
- resolveLibraryParams() : array<string|int, mixed>
- Resolve library params
- setComponentType() : void
- Set component type
- setContext() : void
- Set context
- setError() : void
- Set error
- setHtmlCode() : void
- Set html code
- setLanguage() : void
- Set current language
- setOption() : void
- Set option value
- setOptionFile() : void
- Set option file name
- setParent() : void
- Set parent component info
- setPrimaryTemplate() : void
- Set primary template name
- setPropertiesFileName() : void
- Set properties file name
- setRenderMode() : void
- Set render mode
- toArray() : array<string|int, mixed>
- Convert to array
- url() : string
- Get url
- addPageHeadCode() : void
- Push include code to page head
- componentTypeOption() : void
- Component type option
- getOptionsFileName() : string|null
- Get options file name
- getPageIncludes() : array<string|int, mixed>
- Get page includes
- loadJsonFile() : bool
- Load styles json file
- parseName() : void
- Parse component name
- processDataOption() : void
- Process component include data file option
- processIncludeOption() : void
- Process component include js files option
- processStylesOption() : void
- Process component include styles option
- readTemplatePackageFile() : array<string|int, mixed>
- Read template packaeg file
- resolveHtmlContent() : void
- Resolev html content
- resolveIncludeFile() : array<string|int, mixed>
- Resolve include file
- resolveIncludeFiles() : array<string|int, mixed>
- Resolve include files
- resolveOptionsFileName() : void
- Resolve options file name
- resolvePath() : void
- Resolve component path
- setOptionsFileName() : void
- Set options file name
- resolvePropertiesFileName() : void
- Resolve properties file name
Constants
APPLICATION_ERROR_PAGE
public
mixed
APPLICATION_ERROR_PAGE
= 'application-error'
NAME_SEPARATORS
public
mixed
NAME_SEPARATORS
= ['::' => \Arikaim\Core\Interfaces\View\ComponentInterface::EXTENSION_COMPONENT, '>' => \Arikaim\Core\Interfaces\View\ComponentInterface::PRIMARY_TEMLATE, ':' => \Arikaim\Core\Interfaces\View\ComponentInterface::TEMPLATE_COMPONENT, '~' => \Arikaim\Core\Interfaces\View\ComponentInterface::COMPONENTS_LIBRARY]
PAGE_NOT_FOUND
Error page names
public
mixed
PAGE_NOT_FOUND
= 'page-not-found'
SYSTEM_ERROR_PAGE
public
mixed
SYSTEM_ERROR_PAGE
= 'system-error'
SYSTEM_TEMPLATE_NAME
Control panel template name
public
mixed
SYSTEM_TEMPLATE_NAME
= 'system'
Properties
$id
Component Id
public
string|null
$id
$basePath
Base path
protected
string
$basePath
= ''
$componentInstances
Component instances list
protected
array<string|int, mixed>
$componentInstances
= []
$componentsFiles
Component include files (js)
protected
array<string|int, mixed>
$componentsFiles
= []
$componentType
Component type
protected
string
$componentType
= ''
$context
Component context used in render
protected
array<string|int, mixed>
$context
= []
$data
Component data file content
protected
array<string|int, mixed>
$data
= []
$error
Component error code
protected
string|null
$error
= null
$extensionsPath
Extensions path
protected
string
$extensionsPath
= ''
$filePath
File path
protected
string
$filePath
= ''
$files
Component files
protected
array<string|int, mixed>
$files
= []
$fullName
Component full name
protected
string
$fullName
$fullPath
Component full path
protected
string
$fullPath
= ''
$hasHtmlContent
Return true if compoent has html file
protected
mixed
$hasHtmlContent
= false
$htmlCode
Html code
protected
string
$htmlCode
= ''
$htmlFileName
Html file name
protected
string|null
$htmlFileName
= null
$includedComponents
Included compoents
protected
array<string|int, mixed>
$includedComponents
= []
$language
Language code
protected
string
$language
= ''
$languages
Page languages
protected
array<string|int, mixed>
$languages
$libraryOptions
Ui Library options
protected
array<string|int, mixed>
$libraryOptions
$location
Component Location
protected
int
$location
= \Arikaim\Core\Interfaces\View\ComponentInterface::UNKNOWN_COMPONENT
$name
Component name
protected
string
$name
= ''
$options
Options
protected
array<string|int, mixed>
$options
= []
$optionsFile
Optins file
protected
string
$optionsFile
= 'component.json'
$parent
Parent component info
protected
array<string|int, mixed>
$parent
= []
$path
Component path
protected
string
$path
= ''
$primaryTemplate
Primary template name
protected
string
$primaryTemplate
= ''
$properties
Properies
protected
array<string|int, mixed>
$properties
= []
$removeIncludeOptions
Remove include options
protected
bool
$removeIncludeOptions
= false
$renderMode
Render mode
protected
int
$renderMode
$styles
Component styles file content
protected
array<string|int, mixed>
$styles
= []
$templateName
Template, extension or components library name
protected
string
$templateName
= ''
$templatePath
Template path
protected
string|null
$templatePath
= null
$templateUrl
Template url
protected
string
$templateUrl
$url
Component url
protected
string
$url
= ''
$view
View
protected
ViewInterface
$view
$viewPath
View path
protected
string
$viewPath
= ''
$defaultLanguage
Default language
private
static string
$defaultLanguage
$head
Page head properties
private
PageHead|null
$head
Methods
__construct()
Constructor
public
__construct(ViewInterface $view, string $defaultLanguage[, array<string|int, mixed> $libraryOptions = [] ]) : mixed
Parameters
- $view : ViewInterface
- $defaultLanguage : string
- $libraryOptions : array<string|int, mixed> = []
addComponentFile()
Add component file
public
addComponentFile(string $fileExt) : mixed
Parameters
- $fileExt : string
addComponentInstance()
Add component instance
public
addComponentInstance(string $name, string $type, string $id) : void
Parameters
- $name : string
- $type : string
- $id : string
addFile()
Add file
public
addFile(array<string|int, mixed> $file, string $fileType) : void
Parameters
- $file : array<string|int, mixed>
- $fileType : string
addIncludedComponent()
Add included component
public
addIncludedComponent(string $name, string $type[, string|null $id = null ]) : void
Parameters
- $name : string
- $type : string
- $id : string|null = null
clearContent()
Clear content
public
clearContent() : void
create()
Create component
public
create(string $name, string $language) : ComponentInterface
Parameters
- $name : string
- $language : string
Return values
ComponentInterfacegetBasePath()
Return base path
public
getBasePath() : string
Return values
stringgetComponentFile()
Get component file
public
getComponentFile(string $fileExt) : string|false
Parameters
- $fileExt : string
Return values
string|falsegetComponentFullPath()
Get component full path
public
getComponentFullPath(int $location, string $templateName) : string
Parameters
- $location : int
- $templateName : string
Return values
stringgetComponentInstances()
Get components include files
public
getComponentInstances() : array<string|int, mixed>
Return values
array<string|int, mixed>getComponentsFiles()
Get components include files
public
getComponentsFiles() : array<string|int, mixed>
Return values
array<string|int, mixed>getComponentType()
Get component type
public
getComponentType() : string
Return values
stringgetContext()
Get context
public
getContext() : array<string|int, mixed>
Return values
array<string|int, mixed>getCurrentTemplate()
Get current template name
public
getCurrentTemplate() : string
Return values
stringgetError()
Get error
public
getError() : string|null
Return values
string|nullgetFiles()
Return files
public
getFiles([string $fileType = null ]) : array<string|int, mixed>
Parameters
- $fileType : string = null
Return values
array<string|int, mixed>getFileUrl()
Convert file path to url
public
getFileUrl(string $fileName) : string
Parameters
- $fileName : string
Return values
stringgetFullName()
Get component full name
public
getFullName() : string
Return values
stringgetFullPath()
Get full path
public
getFullPath() : string
Return values
stringgetFullUrl()
Get full page url
public
static getFullUrl(string $path[, string|null $language = null ]) : string
Parameters
- $path : string
- $language : string|null = null
Return values
stringgetHtmlCode()
Get html code
public
getHtmlCode() : string
Return values
stringgetIncludedComponents()
Get included components
public
getIncludedComponents() : array<string|int, mixed>
Return values
array<string|int, mixed>getIncludeFile()
Get include file url
public
getIncludeFile(string $fileType) : string|null
Parameters
- $fileType : string
Return values
string|nullgetIndexFile()
Get page index file
public
getIndexFile(string $currentTemlate) : string
Parameters
- $currentTemlate : string
Return values
stringgetLanguage()
Get language
public
getLanguage() : string
Return values
stringgetLanguages()
Get languages
public
getLanguages() : array<string|int, mixed>
Return values
array<string|int, mixed>getLibraryDetails()
Get library details
public
getLibraryDetails(string $libraryName) : array<string|int, mixed>
Parameters
- $libraryName : string
Return values
array<string|int, mixed>getLibraryFiles()
Get library files
public
getLibraryFiles(string $libraryName, string|null $version[, string|null $option = null ]) : array<string|int, mixed>
Parameters
- $libraryName : string
- $version : string|null
- $option : string|null = null
Return values
array<string|int, mixed>getLibraryIncludeFiles()
Get include library files
public
getLibraryIncludeFiles(array<string|int, mixed> $libraryList, string $cacheKey) : array<string|int, mixed>
Parameters
- $libraryList : array<string|int, mixed>
- $cacheKey : string
Return values
array<string|int, mixed>getLibraryProperties()
Return library properties
public
getLibraryProperties(string $name[, string|null $version = null ]) : array<string|int, mixed>
Parameters
- $name : string
- $version : string|null = null
Return values
array<string|int, mixed>getLocation()
Get location
public
getLocation() : int
Return values
intgetName()
Get component name
public
getName() : string
Return values
stringgetOption()
Get option
public
getOption(string $key[, mixed $default = null ]) : mixed
Parameters
- $key : string
- $default : mixed = null
getOptions()
Get options
public
getOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>getPath()
Get path
public
getPath() : string
Return values
stringgetPrimaryTemplate()
Get primary template
public
getPrimaryTemplate() : string
Return values
stringgetProperties()
Get properties
public
getProperties() : array<string|int, mixed>
Return values
array<string|int, mixed>getPropertiesFileName()
Get properties file name
public
getPropertiesFileName() : string|null
Return values
string|nullgetRenderMode()
Undocumented function
public
getRenderMode() : int
Return values
intgetRootPath()
Get root componetn path
public
getRootPath([bool $relative = false ]) : string
Parameters
- $relative : bool = false
Return values
stringgetTemplateFile()
Get template file
public
getTemplateFile() : string
Return values
stringgetTemplateName()
Get template or extension name
public
getTemplateName() : string
Return values
stringgetTemplatePath()
Get template path
public
getTemplatePath(string $template, int $location) : string
Parameters
- $template : string
- $location : int
Return values
stringgetTemplateUrl()
Get template url
public
getTemplateUrl() : string
Return values
stringgetUrl()
Return url link with current language code
public
static getUrl([string|null $path = '' ][, bool $full = false ][, string|null $language = null ]) : string
Parameters
- $path : string|null = ''
- $full : bool = false
- $language : string|null = null
Return values
stringhasContent()
Return true if component have html content
public
hasContent() : bool
Return values
boolhasError()
Return true if have error
public
hasError() : bool
Return values
boolhasFiles()
Return true if component have files
public
hasFiles([string $fileType = null ]) : bool
Parameters
- $fileType : string = null
Return values
boolhasParent()
Return true if component has child
public
hasParent() : bool
Return values
boolhasProperties()
Return true if component have properties
public
hasProperties() : bool
Return values
boolhead()
Get head properties
public
head() : PageHead
Return values
PageHeadinit()
Init component
public
init() : void
isIncludedComponent()
public
isIncludedComponent() : mixed
isValid()
Return true if component is valid
public
isValid() : bool
Return values
boolloadOptions()
Load options json file
public
loadOptions([bool $useParent = true ]) : void
Parameters
- $useParent : bool = true
loadProperties()
Load properties json file
public
loadProperties() : void
mergeContext()
Merge context
public
mergeContext(array<string|int, mixed> $data) : void
Parameters
- $data : array<string|int, mixed>
mergeData()
Add data to context array
public
mergeData() : void
mergeProperties()
Add properties to context array
public
mergeProperties() : void
mergeRecursiveContext()
Merge recursive context
public
mergeRecursiveContext(array<string|int, mixed> $data) : void
Parameters
- $data : array<string|int, mixed>
mergeStyles()
Add styles to context array
public
mergeStyles() : void
parseLibraryName()
Parse library name (name:version)
public
parseLibraryName(string $libraryName) : array<string|int, mixed>
Parameters
- $libraryName : string
Return values
array<string|int, mixed>render()
Render page
public
render(string $name[, array<string|int, mixed> $params = [] ][, string|null $language = null ]) : ComponentInterface
Parameters
- $name : string
- $params : array<string|int, mixed> = []
- $language : string|null = null
Return values
ComponentInterfacerenderApplicationError()
Render application error
public
renderApplicationError([array<string|int, mixed> $data = [] ][, string|null $language = null ][, string|null $templateName = null ]) : ComponentInterface
Parameters
- $data : array<string|int, mixed> = []
- $language : string|null = null
- $templateName : string|null = null
Return values
ComponentInterfacerenderHtmlComponent()
Render html component
public
renderHtmlComponent(string $name[, array<string|int, mixed> $params = [] ][, string|null $language = null ][, string|null $type = null ][, array<string|int, mixed> $parent = [] ]) : HtmlComponentInterface
Parameters
- $name : string
- $params : array<string|int, mixed> = []
- $language : string|null = null
- $type : string|null = null
- $parent : array<string|int, mixed> = []
Return values
HtmlComponentInterfacerenderPageNotFound()
Render page not found
public
renderPageNotFound([array<string|int, mixed> $data = [] ][, string|null $language = null ][, string|null $templateName = null ]) : ComponentInterface
Parameters
- $data : array<string|int, mixed> = []
- $language : string|null = null
- $templateName : string|null = null
Return values
ComponentInterfacerenderSystemError()
Render system error(s)
public
renderSystemError([array<string|int, mixed> $error = [] ][, string|null $language = null ][, string|null $templateName = null ]) : ComponentInterface
Parameters
- $error : array<string|int, mixed> = []
- $language : string|null = null
- $templateName : string|null = null
Return values
ComponentInterfaceresolve()
Render component data
public
resolve([array<string|int, mixed> $params = [] ]) : bool
Parameters
- $params : array<string|int, mixed> = []
Return values
boolresolveLibraryParams()
Resolve library params
public
resolveLibraryParams(array<string|int, mixed> $properties) : array<string|int, mixed>
Parameters
- $properties : array<string|int, mixed>
Return values
array<string|int, mixed>setComponentType()
Set component type
public
setComponentType(string $type) : void
Parameters
- $type : string
setContext()
Set context
public
setContext(array<string|int, mixed> $context) : void
Parameters
- $context : array<string|int, mixed>
setError()
Set error
public
setError(string $code) : void
Parameters
- $code : string
setHtmlCode()
Set html code
public
setHtmlCode(string $code) : void
Parameters
- $code : string
setLanguage()
Set current language
public
setLanguage(string $language) : void
Parameters
- $language : string
-
Language code
setOption()
Set option value
public
setOption(string $key, mixed $value) : void
Parameters
- $key : string
- $value : mixed
setOptionFile()
Set option file name
public
setOptionFile(string $name) : void
Parameters
- $name : string
setParent()
Set parent component info
public
setParent(array<string|int, mixed> $parent) : void
Parameters
- $parent : array<string|int, mixed>
setPrimaryTemplate()
Set primary template name
public
setPrimaryTemplate(string $name) : void
Parameters
- $name : string
setPropertiesFileName()
Set properties file name
public
setPropertiesFileName(string $fileName) : void
Parameters
- $fileName : string
setRenderMode()
Set render mode
public
setRenderMode(int $mode) : void
Parameters
- $mode : int
toArray()
Convert to array
public
toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>url()
Get url
public
url() : string
Return values
stringaddPageHeadCode()
Push include code to page head
protected
addPageHeadCode(array<string|int, mixed> $includes) : void
Parameters
- $includes : array<string|int, mixed>
componentTypeOption()
Component type option
protected
componentTypeOption() : void
getOptionsFileName()
Get options file name
protected
getOptionsFileName() : string|null
Return values
string|nullgetPageIncludes()
Get page includes
protected
getPageIncludes(string $name, string $language) : array<string|int, mixed>
Parameters
- $name : string
- $language : string
Return values
array<string|int, mixed>loadJsonFile()
Load styles json file
protected
loadJsonFile(string $fileName, string $key) : bool
Parameters
- $fileName : string
- $key : string
Return values
boolparseName()
Parse component name
protected
parseName(string $name) : void
Parameters
- $name : string
processDataOption()
Process component include data file option
protected
processDataOption() : void
processIncludeOption()
Process component include js files option
protected
processIncludeOption() : void
processStylesOption()
Process component include styles option
protected
processStylesOption() : void
readTemplatePackageFile()
Read template packaeg file
protected
readTemplatePackageFile() : array<string|int, mixed>
Return values
array<string|int, mixed>resolveHtmlContent()
Resolev html content
protected
resolveHtmlContent() : void
resolveIncludeFile()
Resolve include file
protected
resolveIncludeFile(string $includeFile) : array<string|int, mixed>
Parameters
- $includeFile : string
-
Component or Url
Return values
array<string|int, mixed>resolveIncludeFiles()
Resolve include files
protected
resolveIncludeFiles(array<string|int, mixed> $include, string $url) : array<string|int, mixed>
Parameters
- $include : array<string|int, mixed>
- $url : string
Return values
array<string|int, mixed>resolveOptionsFileName()
Resolve options file name
protected
resolveOptionsFileName([string|null $path = null ][, bool $useParent = true ]) : void
Parameters
- $path : string|null = null
- $useParent : bool = true
resolvePath()
Resolve component path
protected
resolvePath() : void
setOptionsFileName()
Set options file name
protected
setOptionsFileName(string $fileName) : void
Parameters
- $fileName : string
resolvePropertiesFileName()
Resolve properties file name
private
resolvePropertiesFileName() : void