EmptyComponent
extends BaseComponent
in package
implements
HtmlComponentInterface
Empty component
Table of Contents
Interfaces
- HtmlComponentInterface
- Extension 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
- $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
- $parent : array<string|int, mixed>
- Parent component info
- $path : string
- Component path
- $primaryTemplate : string
- Primary template name
- $renderMode : int
- Render mode
- $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
- 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
- getOptions() : array<string|int, mixed>
- Get options
- getPath() : string
- Get path
- getPrimaryTemplate() : string
- Get primary template
- 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
- init() : void
- Init component
- isIncludedComponent() : mixed
- isValid() : bool
- Return true if component is valid
- mergeContext() : void
- Merge context
- mergeRecursiveContext() : void
- Merge recursive context
- resolve() : bool
- Render component data
- setComponentType() : void
- Set component type
- setContext() : void
- Set context
- setError() : void
- Set error
- setHtmlCode() : void
- Set html code
- setParent() : void
- Set parent component info
- setPrimaryTemplate() : void
- Set primary template name
- setRenderMode() : void
- Set render mode
- toArray() : array<string|int, mixed>
- Convert to array
- url() : string
- Get url
- parseName() : void
- Parse component name
- resolveHtmlContent() : void
- Resolev html content
- resolvePath() : void
- Resolve component path
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
= []
$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
= []
$parent
Parent component info
protected
array<string|int, mixed>
$parent
= []
$path
Component path
protected
string
$path
= ''
$primaryTemplate
Primary template name
protected
string
$primaryTemplate
= ''
$renderMode
Render mode
protected
int
$renderMode
$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>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
stringgetOptions()
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
stringgetRenderMode()
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
boolinit()
Init component
public
init() : void
isIncludedComponent()
public
isIncludedComponent() : mixed
isValid()
Return true if component is valid
public
isValid() : bool
Return values
boolmergeContext()
Merge context
public
mergeContext(array<string|int, mixed> $data) : void
Parameters
- $data : array<string|int, mixed>
mergeRecursiveContext()
Merge recursive context
public
mergeRecursiveContext(array<string|int, mixed> $data) : void
Parameters
- $data : array<string|int, mixed>
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>
setError()
Set error
public
setError(string $code) : void
Parameters
- $code : string
setHtmlCode()
Set html code
public
setHtmlCode(string $code) : void
Parameters
- $code : 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
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
stringparseName()
Parse component name
protected
parseName(string $name) : void
Parameters
- $name : string
resolveHtmlContent()
Resolev html content
protected
resolveHtmlContent() : void
resolvePath()
Resolve component path
protected
resolvePath() : void