class Theme (View source)

Attire Theme Class

Traits

Attire Filekit Trait
Attire Extractor Trait

Constants

MAIN_NAMESPACE

Identifier of the main namespace.

MAIN_THEMENAME

Identifier of the main theme name.

Methods

static bool
rtrim(string $path, string $delimiter = '/')

Right trim a file path.

from FileKit
static bool
haveExtension(string $file)

Check if file have extension.

from FileKit
static bool
isValidFileExtension(string $ext)

Check if the file have a valid extension.

from FileKit
static 
setFileExtension(string $ext)

Set a new file extension.

from FileKit
static string
getFileExtension()

Get current file extension.

from FileKit
__construct(array $options = [])

Class constructor.

static string
getNamespace()

Get Namespace.

static string
getMainThemePath()

Get main theme path.

static string
getName()

Get theme name.

static 
setName(string $name)

Set the theme name.

static 
setPath(string $path)

Set theme default path (without name).

static string
getPath()

Get theme default path.

static 
setTemplate(string $template)

Set the master template.

static string|bool
getTemplate()

Get the current template.

static 
setLayout(string $layout)

Set a new layout.

static string|bool
getLayout()

Get the current layout.

static 
disable($flag = true)

Disable the theme.

static bool
isDisabled()

Check if the theme is disabled.

Details

static bool rtrim(string $path, string $delimiter = '/')

Right trim a file path.

Parameters

string $path File path
string $delimiter Path delimiter

Return Value

bool Cleaned path

static bool haveExtension(string $file)

Check if file have extension.

Parameters

string $file Filename

Return Value

bool TRUE if the file have extension defined and is valid else FALSE

static bool isValidFileExtension(string $ext)

Check if the file have a valid extension.

Parameters

string $ext File extension

Return Value

bool TRUE if is valid

static setFileExtension(string $ext)

Set a new file extension.

Parameters

string $ext Set it if is valid

static string getFileExtension()

Get current file extension.

Return Value

string File extension

__construct(array $options = [])

Class constructor.

Parameters

array $options Class arguments (name, path, tehmplate, layout)

static string getNamespace()

Get Namespace.

Return Value

string

static string getMainThemePath()

Get main theme path.

Return Value

string

static string getName()

Get theme name.

Return Value

string

static setName(string $name)

Set the theme name.

Parameters

string $name Theme name

static setPath(string $path)

Set theme default path (without name).

Parameters

string $path Theme path

static string getPath()

Get theme default path.

Return Value

string Theme path

static setTemplate(string $template)

Set the master template.

Parameters

string $template Template name, ignore if not string

static string|bool getTemplate()

Get the current template.

Return Value

string|bool Return the actual path if exist else FALSE

static setLayout(string $layout)

Set a new layout.

Parameters

string $layout Layout filename path

static string|bool getLayout()

Get the current layout.

Return Value

string|bool Return the actual path if exist else FALSE

static disable($flag = true)

Disable the theme.

Parameters

$flag

static bool isDisabled()

Check if the theme is disabled.

Return Value

bool