Arikaim CMS

JsonComponent extends BaseComponent
in package
implements HtmlComponentInterface Uses Properties

Joson component for render messages

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
$properties  : array<string|int, mixed>
Properies
$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
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
loadProperties()  : void
Load properties json file
mergeContext()  : void
Merge context
mergeProperties()  : void
Add properties to context array
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
setPropertiesFileName()  : void
Set properties file 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
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

$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 = ''

$files

Component files

protected array<string|int, mixed> $files = []

$fullPath

Component full path

protected string $fullPath = ''

$hasHtmlContent

Return true if compoent has html file

protected mixed $hasHtmlContent = false

$htmlFileName

Html file name

protected string|null $htmlFileName = null

$includedComponents

Included compoents

protected array<string|int, mixed> $includedComponents = []

$location

Component Location

protected int $location = \Arikaim\Core\Interfaces\View\ComponentInterface::UNKNOWN_COMPONENT

$options

Options

protected array<string|int, mixed> $options = []

$parent

Parent component info

protected array<string|int, mixed> $parent = []

$primaryTemplate

Primary template name

protected string $primaryTemplate = ''

$properties

Properies

protected array<string|int, mixed> $properties = []

$templateName

Template, extension or components library name

protected string $templateName = ''

$templatePath

Template path

protected string|null $templatePath = null

$templateUrl

Template url

protected string $templateUrl = ''

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

getBasePath()

Return base path

public getBasePath() : string
Return values
string

getComponentFile()

Get component file

public getComponentFile(string $fileExt) : string|false
Parameters
$fileExt : string
Return values
string|false

getComponentFullPath()

Get component full path

public getComponentFullPath(int $location, string $templateName) : string
Parameters
$location : int
$templateName : string
Return values
string

getComponentType()

Get component type

public getComponentType() : string
Return values
string

getContext()

Get context

public getContext() : array<string|int, mixed>
Return values
array<string|int, mixed>

getError()

Get error

public getError() : string|null
Return values
string|null

getFiles()

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
string

getFullName()

Get component full name

public getFullName() : string
Return values
string

getFullPath()

Get full path

public getFullPath() : string
Return values
string

getHtmlCode()

Get html code

public getHtmlCode() : string
Return values
string

getIncludedComponents()

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|null

getLanguage()

Get language

public getLanguage() : string
Return values
string

getLocation()

Get location

public getLocation() : int
Return values
int

getName()

Get component name

public getName() : string
Return values
string

getOptions()

Get options

public getOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>

getPath()

Get path

public getPath() : string
Return values
string

getPrimaryTemplate()

Get primary template

public getPrimaryTemplate() : string
Return values
string

getProperties()

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|null

getRenderMode()

Undocumented function

public getRenderMode() : int
Return values
int

getRootPath()

Get root componetn path

public getRootPath([bool $relative = false ]) : string
Parameters
$relative : bool = false
Return values
string

getTemplateFile()

Get template file

public getTemplateFile() : string
Return values
string

getTemplateName()

Get template or extension name

public getTemplateName() : string
Return values
string

getTemplatePath()

Get template path

public getTemplatePath(string $template, int $location) : string
Parameters
$template : string
$location : int
Return values
string

getTemplateUrl()

Get template url

public getTemplateUrl() : string
Return values
string

hasContent()

Return true if component have html content

public hasContent() : bool
Return values
bool

hasError()

Return true if have error

public hasError() : bool
Return values
bool

hasFiles()

Return true if component have files

public hasFiles([string $fileType = null ]) : bool
Parameters
$fileType : string = null
Return values
bool

hasParent()

Return true if component has child

public hasParent() : bool
Return values
bool

hasProperties()

Return true if component have properties

public hasProperties() : bool
Return values
bool

isValid()

Return true if component is valid

public isValid() : bool
Return values
bool

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>

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>

resolve()

Render component data

public resolve([array<string|int, mixed> $params = [] ]) : bool
Parameters
$params : array<string|int, mixed> = []
Return values
bool

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

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>

parseName()

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

resolvePropertiesFileName()

Resolve properties file name

private resolvePropertiesFileName() : void

        
On this page

Search results