class ArikaimComponent extends BaseComponent implements HtmlComponentInterface, RequireAccessInterface

Arikaim html component

Traits

Component options
Component properties
Data source for components
Include options for view components

Properties

protected string $name Component name from BaseComponent
protected string $fullName Component full name from BaseComponent
protected string $templateName Template, extension or components library name from BaseComponent
protected string $templateUrl Template url from BaseComponent
protected string $path Component path from BaseComponent
protected integer $location Component Location from BaseComponent
protected string $fullPath Component full path from BaseComponent
protected string $filePath File path from BaseComponent
protected string $language Language code from BaseComponent
protected string $htmlCode Html code from BaseComponent
protected string|null $error Component error code from BaseComponent
protected string $basePath Base path from BaseComponent
protected array $files Component files from BaseComponent
protected string $viewPath View path from BaseComponent
protected string $extensionsPath Extensions path from BaseComponent
protected string $primaryTemplate Primary template name from BaseComponent
protected string $componentType Component type from BaseComponent
protected array $context Component context used in render from BaseComponent
protected $hasHtmlContent Return true if compoent has html file from BaseComponent
protected string|null $htmlFileName Html file name from BaseComponent
protected string $url Component url from BaseComponent
protected array $includedComponents Included compoents from BaseComponent
protected array $options Options from BaseComponent
protected boolean $removeIncludeOptions Remove include options from Options
protected string $optionsFile Optins file from Options
protected array $properties Properies from Properties
protected string|null $dataFile Component data file from Data

Methods

__construct(string $name, string $language, string $viewPath, string $extensionsPath, string $primaryTemplate)

Constructor

void
init()

Init component

array
getOptions()

Get options

bool
resolve(array $params = [])

Render component data

bool
isValid()

Return true if component is valid

void
addIncludedComponent(string $name, string $type)

Add included component

array
getIncludedComponents()

Get included components

mixed
create(string $name, string $language)

Create component

array
getContext()

Get context

void
setContext(array $context)

Set context

void
mergeContext(array $data)

Merge context

void
mergeRecursiveContext(array $data)

Merge recursive context

string|null
getIncludeFile(string $fileType)

Get include file url

void
setPrimaryTemplate(string $name)

Set primary template name

string
getPrimaryTemplate()

Get primary template

bool
hasParent()

Return true if component has child

string
getBasePath()

Return base path

string
getName()

Get component name

string|null
getFullName()

Get component full name

string|null
getTemplateFile()

Get template file

bool
hasError()

Return true if have error

bool
hasContent()

Return true if component have html content

void
resolveHtmlContent()

Resolev html content

bool
hasFiles(string|null $fileType = null)

Return true if component have files

array
getFiles(string|null $fileType = null)

Return files

string|null
getPath()

Get path

string
getFullPath()

Get full path

string
getComponentType()

Get component type

void
setComponentType(string $type)

Set component type

int
getLocation()

Get location

string|null
getTemplateName()

Get template or extension name

string
getLanguage()

Get language

string|null
getError()

Get error

string
getHtmlCode()

Get html code

void
setHtmlCode(string $code)

Set html code

void
setError(string $code)

Set error

void
clearContent()

Clear content

mixed
addComponentFile(string $fileExt)

Add component file

void
addFile(array $file, string $fileType)

Add file

void
parseName(string $name)

Parse component name

array
toArray()

Convert to array

string
url()

Get url

string
getRootPath(bool $relative = false)

Get root componetn path

string
getTemplatePath(string $template, int $location)

Get template path

string|false
getComponentFile(string $fileExt)

Get component file

string
getFileUrl(string $fileName)

Convert file path to url

string
getComponentFullPath(int $location, string $templateName)

Get component full path

void
resolvePath()

Resolve component path

string
getTemplateUrl()

Get template url

void
componentTypeOption()

Component type option

from Options
void
setOptionFile(string $name)

Set option file name

from Options
mixed
getOption(string $key, mixed $default = null)

Get option

from Options
void
setOption(string $key, mixed $value)

Set option value

from Options
void
loadOptions()

Load options json file

from Options
string|null
getOptionsFileName()

Get options file name

from Options
void
setOptionsFileName(string $fileName)

Set options file name

from Options
void
resolveOptionsFileName(string|null $path = null)

Resolve options file name

from Options
void
loadProperties()

Load properties json file

void
mergeProperties()

Add properties to context array

bool
hasProperties()

Return true if component have properties

array
getProperties()

Get properties

string|null
getPropertiesFileName()

Get properties file name

void
setPropertiesFileName(string $fileName)

Set properties file name

string|null
getDataFile()

Get component data file.

from Data
void
resolveDataFile()

Resolve component data file

from Data
bool
processDataFile(array $params, Container|null $container = null)

Process daat file

from Data
void
processIncludeOption()

Process component include js files option

array|null
resolveIncludeFile(string $includeFile)

Resolve include file

Details

at line 41
__construct(string $name, string $language, string $viewPath, string $extensionsPath, string $primaryTemplate)

Constructor

Parameters

string $name
string $language
string $viewPath
string $extensionsPath
string $primaryTemplate

at line 61
void init()

Init component

Return Value

void

in BaseComponent at line 237
array getOptions()

Get options

Return Value

array

at line 79
bool resolve(array $params = [])

Render component data

Parameters

array $params

Return Value

bool

at line 51
bool isValid()

Return true if component is valid

Return Value

bool

in BaseComponent at line 270
void addIncludedComponent(string $name, string $type)

Add included component

Parameters

string $name
string $type

Return Value

void

in BaseComponent at line 286
array getIncludedComponents()

Get included components

Return Value

array

in BaseComponent at line 298
mixed create(string $name, string $language)

Create component

Parameters

string $name
string $language

Return Value

mixed

in BaseComponent at line 315
array getContext()

Get context

Return Value

array

in BaseComponent at line 326
void setContext(array $context)

Set context

Parameters

array $context

Return Value

void

in BaseComponent at line 337
void mergeContext(array $data)

Merge context

Parameters

array $data

Return Value

void

in BaseComponent at line 348
void mergeRecursiveContext(array $data)

Merge recursive context

Parameters

array $data

Return Value

void

in BaseComponent at line 359
string|null getIncludeFile(string $fileType)

Get include file url

Parameters

string $fileType

Return Value

string|null

in BaseComponent at line 372
void setPrimaryTemplate(string $name)

Set primary template name

Parameters

string $name

Return Value

void

in BaseComponent at line 382
string getPrimaryTemplate()

Get primary template

Return Value

string

in BaseComponent at line 392
bool hasParent()

Return true if component has child

Return Value

bool

in BaseComponent at line 407
string getBasePath()

Return base path

Return Value

string

in BaseComponent at line 417
string getName()

Get component name

Return Value

string

in BaseComponent at line 427
string|null getFullName()

Get component full name

Return Value

string|null

in BaseComponent at line 438
string|null getTemplateFile()

Get template file

Return Value

string|null

in BaseComponent at line 448
bool hasError()

Return true if have error

Return Value

bool

in BaseComponent at line 458
bool hasContent()

Return true if component have html content

Return Value

bool

in BaseComponent at line 468
protected void resolveHtmlContent()

Resolev html content

Return Value

void

in BaseComponent at line 479
bool hasFiles(string|null $fileType = null)

Return true if component have files

Parameters

string|null $fileType

Return Value

bool

in BaseComponent at line 498
array getFiles(string|null $fileType = null)

Return files

Parameters

string|null $fileType

Return Value

array

in BaseComponent at line 508
string|null getPath()

Get path

Return Value

string|null

in BaseComponent at line 518
string getFullPath()

Get full path

Return Value

string

in BaseComponent at line 528
string getComponentType()

Get component type

Return Value

string

in BaseComponent at line 539
void setComponentType(string $type)

Set component type

Parameters

string $type

Return Value

void

in BaseComponent at line 549
int getLocation()

Get location

Return Value

int

in BaseComponent at line 559
string|null getTemplateName()

Get template or extension name

Return Value

string|null

in BaseComponent at line 569
string getLanguage()

Get language

Return Value

string

in BaseComponent at line 579
string|null getError()

Get error

Return Value

string|null

in BaseComponent at line 589
string getHtmlCode()

Get html code

Return Value

string

in BaseComponent at line 600
void setHtmlCode(string $code)

Set html code

Parameters

string $code

Return Value

void

in BaseComponent at line 611
void setError(string $code)

Set error

Parameters

string $code

Return Value

void

in BaseComponent at line 621
void clearContent()

Clear content

Return Value

void

in BaseComponent at line 636
mixed addComponentFile(string $fileExt)

Add component file

Parameters

string $fileExt

Return Value

mixed

in BaseComponent at line 662
void addFile(array $file, string $fileType)

Add file

Parameters

array $file
string $fileType

Return Value

void

in BaseComponent at line 675
protected void parseName(string $name)

Parse component name

Parameters

string $name

Return Value

void

in BaseComponent at line 733
array toArray()

Convert to array

Return Value

array

in BaseComponent at line 743
string url()

Get url

Return Value

string

in BaseComponent at line 754
string getRootPath(bool $relative = false)

Get root componetn path

Parameters

bool $relative

Return Value

string

in BaseComponent at line 771
string getTemplatePath(string $template, int $location)

Get template path

Parameters

string $template
int $location

Return Value

string

in BaseComponent at line 791
string|false getComponentFile(string $fileExt)

Get component file

Parameters

string $fileExt

Return Value

string|false

in BaseComponent at line 804
string getFileUrl(string $fileName)

Convert file path to url

Parameters

string $fileName

Return Value

string

in BaseComponent at line 815
string getComponentFullPath(int $location, string $templateName)

Get component full path

Parameters

int $location
string $templateName

Return Value

string

in BaseComponent at line 828
protected void resolvePath()

Resolve component path

Return Value

void

in BaseComponent at line 864
string getTemplateUrl()

Get template url

Return Value

string

in Options at line 36
protected void componentTypeOption()

Component type option

Return Value

void

in Options at line 51
void setOptionFile(string $name)

Set option file name

Parameters

string $name

Return Value

void

in Options at line 63
mixed getOption(string $key, mixed $default = null)

Get option

Parameters

string $key
mixed $default

Return Value

mixed

in Options at line 75
void setOption(string $key, mixed $value)

Set option value

Parameters

string $key
mixed $value

Return Value

void

in Options at line 85
void loadOptions()

Load options json file

Return Value

void

in Options at line 109
protected string|null getOptionsFileName()

Get options file name

Return Value

string|null

in Options at line 120
protected void setOptionsFileName(string $fileName)

Set options file name

Parameters

string $fileName

Return Value

void

in Options at line 131
protected void resolveOptionsFileName(string|null $path = null)

Resolve options file name

Parameters

string|null $path

Return Value

void

in Properties at line 50
void loadProperties()

Load properties json file

Return Value

void

in Properties at line 68
void mergeProperties()

Add properties to context array

Return Value

void

in Properties at line 78
bool hasProperties()

Return true if component have properties

Return Value

bool

in Properties at line 92
array getProperties()

Get properties

Return Value

array

in Properties at line 102
string|null getPropertiesFileName()

Get properties file name

Return Value

string|null

in Properties at line 113
void setPropertiesFileName(string $fileName)

Set properties file name

Parameters

string $fileName

Return Value

void

in Data at line 31
string|null getDataFile()

Get component data file.

Return Value

string|null

in Data at line 41
protected void resolveDataFile()

Resolve component data file

Return Value

void

in Data at line 55
protected bool processDataFile(array $params, Container|null $container = null)

Process daat file

Parameters

array $params
Container|null $container

Return Value

bool

in IncludeOption at line 24
protected void processIncludeOption()

Process component include js files option

Return Value

void

in IncludeOption at line 48
protected array|null resolveIncludeFile(string $includeFile)

Resolve include file

Parameters

string $includeFile Component or Url

Return Value

array|null