Arikaim CMS

EmailView extends BaseComponent
in package
implements HtmlComponentInterface, EmailViewInterface Uses Options, IndexPage, UiLibrary, Properties

Render email component

Table of Contents

Interfaces

HtmlComponentInterface
Extension interface
EmailViewInterface
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
$data  : array<string|int, mixed>
Component data file content
$defaultLanguage  : string
Default language
$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
$view  : ViewInterface
View
$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
getCurrentTemplate()  : string
Get current template name
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
getIndexFile()  : string
Get page index file
getLanguage()  : string
Get language
getLibraryDetails()  : array<string|int, mixed>
Get library details
getLibraryFiles()  : array<string|int, mixed>
Get library files
getLibraryName()  : string
Get css email library name
getLibraryProperties()  : array<string|int, mixed>
Return library properties
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
getSubject()  : string
Get email subject
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
loadOptions()  : void
Load options json file
loadProperties()  : void
Load properties json file
mergeContext()  : void
Merge context
mergeData()  : void
Add data to context array
mergeProperties()  : void
Add properties to context array
mergeRecursiveContext()  : void
Merge recursive context
mergeStyles()  : void
Add styles to context array
parseLibraryName()  : array<string|int, mixed>
Parse library name (name:version)
readLibraryCode()  : string
Read UI library css code
render()  : EmailViewInterface|null
Render email component
resolve()  : bool
Render component data
resolveLibraryParams()  : array<string|int, mixed>
Resolve library params
setComponentType()  : void
Set component type
setContext()  : void
Set context
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
getOptionsFileName()  : string|null
Get options file name
loadJsonFile()  : bool
Load styles json file
parseName()  : void
Parse component name
processDataOption()  : void
Process component include data file option
processStylesOption()  : void
Process component include styles option
resolveHtmlContent()  : void
Resolev html content
resolveOptionsFileName()  : void
Resolve options file name
resolvePath()  : void
Resolve component path
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

$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 = []

$defaultLanguage

Default language

protected string $defaultLanguage

$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 = []

$optionsFile

Optins file

protected string $optionsFile = 'component.json'

$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 = []

$removeIncludeOptions

Remove include options

protected bool $removeIncludeOptions = false

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

Methods

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>

getCurrentTemplate()

Get current template name

public getCurrentTemplate() : string
Return values
string

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

getIndexFile()

Get page index file

public getIndexFile(string $currentTemlate) : string
Parameters
$currentTemlate : string
Return values
string

getLanguage()

Get language

public getLanguage() : string
Return values
string

getLibraryDetails()

Get library details

public getLibraryDetails(string $libraryName) : array<string|int, mixed>
Parameters
$libraryName : string
Return values
array<string|int, mixed>

getLibraryFiles()

Get library files

public getLibraryFiles(string $libraryName, string|null $version[, string|null $option = null ]) : array<string|int, mixed>
Parameters
$libraryName : string
$version : string|null
$option : string|null = null
Return values
array<string|int, mixed>

getLibraryName()

Get css email library name

public getLibraryName() : string
Return values
string

getLibraryProperties()

Return library properties

public getLibraryProperties(string $name[, string|null $version = null ]) : array<string|int, mixed>
Parameters
$name : string
$version : string|null = null
Return values
array<string|int, mixed>

getLocation()

Get location

public getLocation() : int
Return values
int

getName()

Get component name

public getName() : string
Return values
string

getOption()

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

getSubject()

Get email subject

public getSubject() : string
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

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

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

parseLibraryName()

Parse library name (name:version)

public parseLibraryName(string $libraryName) : array<string|int, mixed>
Parameters
$libraryName : string
Return values
array<string|int, mixed>

readLibraryCode()

Read UI library css code

public readLibraryCode(string $name) : string
Parameters
$name : string
Return values
string

render()

Render email component

public render(string $name[, array<string|int, mixed> $params = [] ][, string|null $language = null ]) : EmailViewInterface|null
Parameters
$name : string
$params : array<string|int, mixed> = []
$language : string|null = null
Return values
EmailViewInterface|null

resolve()

Render component data

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

resolveLibraryParams()

Resolve library params

public resolveLibraryParams(array<string|int, mixed> $properties) : array<string|int, mixed>
Parameters
$properties : array<string|int, mixed>
Return values
array<string|int, mixed>

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

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>

componentTypeOption()

Component type option

protected componentTypeOption() : void

getOptionsFileName()

Get options file name

protected getOptionsFileName() : string|null
Return values
string|null

loadJsonFile()

Load styles json file

protected loadJsonFile(string $fileName, string $key) : bool
Parameters
$fileName : string
$key : string
Return values
bool

parseName()

Parse component name

protected parseName(string $name) : void
Parameters
$name : string

processDataOption()

Process component include data file option

protected processDataOption() : void

processStylesOption()

Process component include styles option

protected processStylesOption() : void

resolveHtmlContent()

Resolev html content

protected resolveHtmlContent() : void

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

setOptionsFileName()

Set options file name

protected setOptionsFileName(string $fileName) : void
Parameters
$fileName : string

resolvePropertiesFileName()

Resolve properties file name

private resolvePropertiesFileName() : void

        
On this page

Search results