ArikaimComponent
extends BaseComponent
in package
implements
HtmlComponentInterface, RequireAccessInterface
Uses
Options, ComponentEditor, Properties, Data, IncludeOption
Arikaim html component
Table of Contents
Interfaces
- HtmlComponentInterface
- Extension interface
- RequireAccessInterface
- Require access interface
Constants
- 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]
Properties
- $id : string|null
- Component Id
- $basePath : string
- Base path
- $componentType : string
- Component type
- $context : array<string|int, mixed>
- Component context used in render
- $data : array<string|int, mixed>
- Component data file content
- $dataFile : string|null
- Component data file
- $editorOptions : array<string|int, mixed>
- Editor options
- $editorOptionsFile : string
- Optins file
- $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
- $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
- $viewPath : string
- View path
Methods
- __construct() : mixed
- Constructor
- addComponentFile() : mixed
- Add component file
- 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
- getComponentType() : string
- Get component type
- getContext() : array<string|int, mixed>
- Get context
- getDataFile() : string|null
- Get component data file.
- getEditorOption() : mixed
- Get editor option
- 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
- getHtmlCode() : string
- Get html code
- getIncludedComponents() : array<string|int, mixed>
- Get included components
- getIncludeFile() : string|null
- Get include file url
- getLanguage() : string
- Get language
- 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
- 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
- init() : void
- Init component
- isIncludedComponent() : mixed
- isValid() : bool
- Return true if component is valid
- loadEditorOptions() : void
- Load editor options json file
- loadOptions() : void
- Load options json file
- loadProperties() : void
- Load properties json file
- mergeContext() : void
- Merge context
- mergeData() : void
- Add data to context array
- mergeEditorOptions() : void
- Add editor options to context array
- mergeProperties() : void
- Add properties to context array
- mergeRecursiveContext() : void
- Merge recursive context
- mergeStyles() : void
- Add styles to context array
- resolve() : bool
- Render component data
- setComponentType() : void
- Set component type
- setContext() : void
- Set context
- setEditorOption() : void
- Set editor option value
- setError() : void
- Set error
- setHtmlCode() : void
- Set html code
- 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
- componentTypeOption() : void
- Component type option
- getEditorOptionsFileName() : string|null
- Get editor options file name
- getOptionsFileName() : string|null
- Get options file name
- loadJsonFile() : bool
- Load styles json file
- parseName() : void
- Parse component name
- processDataFile() : bool
- Process daat file
- processDataOption() : void
- Process component include data file option
- processIncludeOption() : void
- Process component include js files option
- processStylesOption() : void
- Process component include styles option
- resolveDataFile() : void
- Resolve component data file
- resolveEditorOptionsFileName() : void
- Resolve editor options file name
- resolveHtmlContent() : void
- Resolev html content
- resolveIncludeFile() : array<string|int, mixed>
- Resolve include file
- resolveOptionsFileName() : void
- Resolve options file name
- resolvePath() : void
- Resolve component path
- setEditorOptionsFileName() : void
- Set editor options file name
- setOptionsFileName() : void
- Set options file name
- resolvePropertiesFileName() : void
- Resolve properties file name
Constants
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]
Properties
$id
Component Id
public
string|null
$id
$basePath
Base path
protected
string
$basePath
= ''
$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
= []
$dataFile
Component data file
protected
string|null
$dataFile
= null
$editorOptions
Editor options
protected
array<string|int, mixed>
$editorOptions
= []
$editorOptionsFile
Optins file
protected
string
$editorOptionsFile
= 'editor.json'
$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
= ''
$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
= ''
$viewPath
View path
protected
string
$viewPath
= ''
Methods
__construct()
Constructor
public
__construct(string $name, string $language, string $viewPath, string $extensionsPath, string $primaryTemplate) : mixed
Parameters
- $name : string
- $language : string
- $viewPath : string
- $extensionsPath : string
- $primaryTemplate : string
addComponentFile()
Add component file
public
addComponentFile(string $fileExt) : mixed
Parameters
- $fileExt : 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
stringgetComponentType()
Get component type
public
getComponentType() : string
Return values
stringgetContext()
Get context
public
getContext() : array<string|int, mixed>
Return values
array<string|int, mixed>getDataFile()
Get component data file.
public
getDataFile() : string|null
Return values
string|nullgetEditorOption()
Get editor option
public
getEditorOption(string $key[, mixed $default = null ]) : mixed
Parameters
- $key : string
- $default : mixed = null
getError()
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
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|nullgetLanguage()
Get language
public
getLanguage() : string
Return values
stringgetLocation()
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
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
boolinit()
Init component
public
init() : void
isIncludedComponent()
public
isIncludedComponent() : mixed
isValid()
Return true if component is valid
public
isValid() : bool
Return values
boolloadEditorOptions()
Load editor options json file
public
loadEditorOptions() : void
loadOptions()
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
mergeEditorOptions()
Add editor options to context array
public
mergeEditorOptions() : 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
resolve()
Render component data
public
resolve([array<string|int, mixed> $params = [] ]) : bool
Parameters
- $params : array<string|int, mixed> = []
Return values
boolsetComponentType()
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>
setEditorOption()
Set editor option value
public
setEditorOption(string $key, mixed $value) : void
Parameters
- $key : string
- $value : mixed
setError()
Set error
public
setError(string $code) : void
Parameters
- $code : string
setHtmlCode()
Set html code
public
setHtmlCode(string $code) : void
Parameters
- $code : string
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
stringcomponentTypeOption()
Component type option
protected
componentTypeOption() : void
getEditorOptionsFileName()
Get editor options file name
protected
getEditorOptionsFileName() : string|null
Return values
string|nullgetOptionsFileName()
Get options file name
protected
getOptionsFileName() : string|null
Return values
string|nullloadJsonFile()
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
processDataFile()
Process daat file
protected
processDataFile(array<string|int, mixed> $params[, Container|null $container = null ]) : bool
Parameters
- $params : array<string|int, mixed>
- $container : Container|null = null
Return values
boolprocessDataOption()
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
resolveDataFile()
Resolve component data file
protected
resolveDataFile() : void
resolveEditorOptionsFileName()
Resolve editor options file name
protected
resolveEditorOptionsFileName([string|null $path = null ]) : void
Parameters
- $path : string|null = null
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>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
setEditorOptionsFileName()
Set editor options file name
protected
setEditorOptionsFileName(string $fileName) : void
Parameters
- $fileName : string
setOptionsFileName()
Set options file name
protected
setOptionsFileName(string $fileName) : void
Parameters
- $fileName : string
resolvePropertiesFileName()
Resolve properties file name
private
resolvePropertiesFileName() : void