class Views (View source)

Attire Views Class

Traits

Attire Filekit Trait

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

Class constructor.

array
getStored()

Get stored views.

add(string $view, array $params = [])

Add a view.

static string
parse(string $view)

Parse a view with Attire preferences.

remove(string $view)

Remove specific view.

reset()

Clear all the stored views.

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

Class constructor.

array getStored()

Get stored views.

Return Value

array Set of stored views with their respective params

Views add(string $view, array $params = [])

Add a view.

Parameters

string $view View filename
array $params View parameters

Return Value

Views

static string parse(string $view)

Parse a view with Attire preferences.

Parameters

string $view View filename

Return Value

string

Views remove(string $view)

Remove specific view.

Parameters

string $view View filename

Return Value

Views

Views reset()

Clear all the stored views.

Return Value

Views