class ThemeHandler

Properties

protected ThemeEntity[] $themeList
$configDelimiter
protected $cachePath
protected string $configKey
protected ThemeEntity $selectedTheme
protected string $selectedThemeId
protected PluginRegister $register
protected ConfigManager $config
protected string $blankTheme
protected Closure $mobileResolver
protected Factory $viewFactory

Methods

__construct(PluginRegister $register, ConfigManager $config, Factory $viewFactory, string $blankTheme)

생성자

Factory
getViewFactory()

get ViewFactory

void
setMobileResolver(Closure $callback)

현재 요청이 모바일 버전인지 조회할 때 사용되는 resolver를 지정한다.

void
setCachePath(string $path)

set view cache path

string
getCachePath(string $path)

retrieve view cache path

bool
hasCache(string $path)

check whether has cache or not

getMobileResolver()

현재 요청이 모바일 버전인지 조회할 때 사용되는 resolver를 조회한다.

void
selectTheme(string $id)

현재 Request에서 사용될 테마를 지정한다. 이 메소드를 이용하여 테마를 지정하면, theme middleware에서 지정된 테마를 자동으로 출력한다.

void
selectSiteTheme(null $mode = null)

사이트 기본테마를 사용할 테마로 지정한다.

void
selectBlankTheme()

아무 테마도 지정하지 않는다. 내부적으로는 blankTheme를 지정한다.

void
deselectTheme()

alias for selectBlankTheme()

getSelectedTheme()

현재 Request에서 사용되는 테마를 반환한다. 반환되는 테마는 일반 테마일 수도 있고, 관리페이지용 테마일수도 있다.

getTheme(string $instanceId)

등록된 테마중 주어진 id를 가진 테마를 반환한다.

void
setSiteTheme(string $id, null|string $mode = null)

사이트 기본 테마를 지정한다. 사이트 기본 테마 정보는 데이터베이스에 저장 된다.

mixed
getSiteThemeId(null|string $mode = null)

사이트 기본 테마를 조회한다.

array
getAllTheme()

모든 일반 테마 목록을 반환한다.

array
getAllThemeSupportingMobile()

getAllThemeSupportingMobile

array
getAllThemeSupportingDesktop()

getAllThemeSupportingDesktop

array
getAllSettingsTheme()

모든 관리페이지 테마 목록을 반환한다.

bool
hasThemeConfig(string $id)

주어진 테마가 저장된 config data를 가지고 있는지 검사한다.

getThemeConfig(string $id, bool $create = false)

주어진 테마에 저장된 config data를 반환한다.

void
setThemeConfig(string $id, string|array $key, mixed $configData = null)

주어진 테마의 config data를 저장한다.

void
deleteThemeConfig(string $id)

주어진 테마의 config data를 삭제한다.

array
getThemeConfigList(string $id)

주어진 테마에 저장된 모든 config data를 반환한다.

string
getConfigId(string $id)

config id for given theme

makeEntity(string $id, string $class)

make and return ThemeEntity

Details

at line 91
__construct(PluginRegister $register, ConfigManager $config, Factory $viewFactory, string $blankTheme)

생성자

Parameters

PluginRegister $register plugin registry manager
ConfigManager $config config manager
Factory $viewFactory view factory
string $blankTheme blanktheme_id

at line 104
Factory getViewFactory()

get ViewFactory

Return Value

Factory

at line 116
void setMobileResolver(Closure $callback)

현재 요청이 모바일 버전인지 조회할 때 사용되는 resolver를 지정한다.

Parameters

Closure $callback resolver

Return Value

void

at line 128
void setCachePath(string $path)

set view cache path

Parameters

string $path cache path

Return Value

void

at line 140
string getCachePath(string $path)

retrieve view cache path

Parameters

string $path cache path

Return Value

string

at line 153
bool hasCache(string $path)

check whether has cache or not

Parameters

string $path cache path

Return Value

bool

at line 164
Closure getMobileResolver()

현재 요청이 모바일 버전인지 조회할 때 사용되는 resolver를 조회한다.

Return Value

Closure

at line 177
void selectTheme(string $id)

현재 Request에서 사용될 테마를 지정한다. 이 메소드를 이용하여 테마를 지정하면, theme middleware에서 지정된 테마를 자동으로 출력한다.

Parameters

string $id 지정할 테마의 id

Return Value

void

at line 192
void selectSiteTheme(null $mode = null)

사이트 기본테마를 사용할 테마로 지정한다.

mode가 지정되지 않았을 경우 mobile resolver로부터 mode를 구한다. mode가 지정돼 있을 경우 해당 mode의 테마를 지정한다.

Parameters

null $mode mobile or desktop

Return Value

void

at line 206
void selectBlankTheme()

아무 테마도 지정하지 않는다. 내부적으로는 blankTheme를 지정한다.

Return Value

void

at line 216
void deselectTheme()

alias for selectBlankTheme()

Return Value

void

at line 226
ThemeEntity getSelectedTheme()

현재 Request에서 사용되는 테마를 반환한다. 반환되는 테마는 일반 테마일 수도 있고, 관리페이지용 테마일수도 있다.

Return Value

ThemeEntity

at line 245
ThemeEntity getTheme(string $instanceId)

등록된 테마중 주어진 id를 가진 테마를 반환한다.

Parameters

string $instanceId 조회할 테마의 id

Return Value

ThemeEntity

at line 275
void setSiteTheme(string $id, null|string $mode = null)

사이트 기본 테마를 지정한다. 사이트 기본 테마 정보는 데이터베이스에 저장 된다.

Parameters

string $id 사이트 기본 테마로 지정할 테마의 아이디, 만약 array일 경우, mobile, desktop용 테마를 동시에 지정한다.
null|string $mode mobile or desktop, mode가 지정돼 있을 경우 해당 mode만 저장된다.

Return Value

void

at line 296
mixed getSiteThemeId(null|string $mode = null)

사이트 기본 테마를 조회한다.

Parameters

null|string $mode mobile or desktop

Return Value

mixed

at line 316
array getAllTheme()

모든 일반 테마 목록을 반환한다.

Return Value

array

at line 332
array getAllThemeSupportingMobile()

getAllThemeSupportingMobile

Return Value

array

at line 349
array getAllThemeSupportingDesktop()

getAllThemeSupportingDesktop

Return Value

array

at line 366
array getAllSettingsTheme()

모든 관리페이지 테마 목록을 반환한다.

Return Value

array

at line 382
bool hasThemeConfig(string $id)

주어진 테마가 저장된 config data를 가지고 있는지 검사한다.

Parameters

string $id theme instance id

Return Value

bool

at line 396
ConfigEntity getThemeConfig(string $id, bool $create = false)

주어진 테마에 저장된 config data를 반환한다.

Parameters

string $id array $id theme id
bool $create if $create is true and theme config do not exists, create theme config

Return Value

ConfigEntity

at line 421
void setThemeConfig(string $id, string|array $key, mixed $configData = null)

주어진 테마의 config data를 저장한다.

Parameters

string $id theme id
string|array $key config data or config key for setting value
mixed $configData config

Return Value

void

at line 446
void deleteThemeConfig(string $id)

주어진 테마의 config data를 삭제한다.

Parameters

string $id theme id

Return Value

void

at line 459
array getThemeConfigList(string $id)

주어진 테마에 저장된 모든 config data를 반환한다.

Parameters

string $id theme id

Return Value

array

at line 483
string getConfigId(string $id)

config id for given theme

Parameters

string $id theme id

Return Value

string config id

at line 496
protected ThemeEntity makeEntity(string $id, string $class)

make and return ThemeEntity

Parameters

string $id theme id
string $class theme class name

Return Value

ThemeEntity