JsComponent
class JsComponent extends BaseComponent implements HtmlComponentInterface
Js file component
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 |
Methods
Constructor
Init component
Render component data
Return true if component is valid
Get component full path
Details
at line 29
__construct(string $name, string $language, string $viewPath, string $extensionsPath, string $primaryTemplate)
Constructor
at line 49
void
init()
Init component
in BaseComponent at line 237
array
getOptions()
Get options
at line 62
bool
resolve(array $params = [])
Render component data
at line 39
bool
isValid()
Return true if component is valid
in BaseComponent at line 270
void
addIncludedComponent(string $name, string $type)
Add included component
in BaseComponent at line 286
array
getIncludedComponents()
Get included components
in BaseComponent at line 298
mixed
create(string $name, string $language)
Create component
in BaseComponent at line 315
array
getContext()
Get context
in BaseComponent at line 326
void
setContext(array $context)
Set context
in BaseComponent at line 337
void
mergeContext(array $data)
Merge context
in BaseComponent at line 348
void
mergeRecursiveContext(array $data)
Merge recursive context
in BaseComponent at line 359
string|null
getIncludeFile(string $fileType)
Get include file url
in BaseComponent at line 372
void
setPrimaryTemplate(string $name)
Set primary template name
in BaseComponent at line 382
string
getPrimaryTemplate()
Get primary template
in BaseComponent at line 392
bool
hasParent()
Return true if component has child
in BaseComponent at line 407
string
getBasePath()
Return base path
in BaseComponent at line 417
string
getName()
Get component name
in BaseComponent at line 427
string|null
getFullName()
Get component full name
in BaseComponent at line 438
string|null
getTemplateFile()
Get template file
in BaseComponent at line 448
bool
hasError()
Return true if have error
in BaseComponent at line 458
bool
hasContent()
Return true if component have html content
in BaseComponent at line 468
protected void
resolveHtmlContent()
Resolev html content
in BaseComponent at line 479
bool
hasFiles(string|null $fileType = null)
Return true if component have files
in BaseComponent at line 498
array
getFiles(string|null $fileType = null)
Return files
in BaseComponent at line 508
string|null
getPath()
Get path
in BaseComponent at line 518
string
getFullPath()
Get full path
in BaseComponent at line 528
string
getComponentType()
Get component type
in BaseComponent at line 539
void
setComponentType(string $type)
Set component type
in BaseComponent at line 549
int
getLocation()
Get location
in BaseComponent at line 559
string|null
getTemplateName()
Get template or extension name
in BaseComponent at line 569
string
getLanguage()
Get language
in BaseComponent at line 579
string|null
getError()
Get error
in BaseComponent at line 589
string
getHtmlCode()
Get html code
in BaseComponent at line 600
void
setHtmlCode(string $code)
Set html code
in BaseComponent at line 611
void
setError(string $code)
Set error
in BaseComponent at line 621
void
clearContent()
Clear content
in BaseComponent at line 636
mixed
addComponentFile(string $fileExt)
Add component file
in BaseComponent at line 662
void
addFile(array $file, string $fileType)
Add file
in BaseComponent at line 675
protected void
parseName(string $name)
Parse component name
in BaseComponent at line 733
array
toArray()
Convert to array
in BaseComponent at line 743
string
url()
Get url
in BaseComponent at line 754
string
getRootPath(bool $relative = false)
Get root componetn path
in BaseComponent at line 771
string
getTemplatePath(string $template, int $location)
Get template path
in BaseComponent at line 791
string|false
getComponentFile(string $fileExt)
Get component file
in BaseComponent at line 804
string
getFileUrl(string $fileName)
Convert file path to url
in BaseComponent at line 815
string
getComponentFullPath(int $location, string $templateName)
Get component full path
in BaseComponent at line 828
protected void
resolvePath()
Resolve component path
in BaseComponent at line 864
string
getTemplateUrl()
Get template url