class TemplatesManager

Class TemplatesManager manages updating templates, removing and additional admin functions

Properties

array $errors Errors are kept in an array and can be used later if validation fails and we want to know why
string $message This is a message that we can store why the validation failed
$messages Validation messages

Methods

__construct(FileManager $ConfigFileManager, Framework $Framework)

Construct a new template manager

void
registerRules()

Validation rules for registering a new template

bool
storeTemplate(array $input)

Validate and store a template entry to templates config

bool
storeMultipleTemplates($inputs)

Validate and store multiple template entries to templates config

bool
updateTemplate($input)

Validates and updates a template with the given input

boolean
destroyTemplate(string $templatePath)

Destroys a template by retrieving current config contents and unsetting the key (templatePath) then saving the updated contents

void
createVarRules()

Validation rules for registering a new template

bool
storeNewVariable(string $templatePath, array $input)

Validate and store a new variable for a given template path

Details

at line 43
__construct(FileManager $ConfigFileManager, Framework $Framework)

Construct a new template manager

Parameters

FileManager $ConfigFileManager
Framework $Framework

at line 68
void registerRules()

Validation rules for registering a new template

Return Value

void

at line 82
bool storeTemplate(array $input)

Validate and store a template entry to templates config

Parameters

array $input

Return Value

bool

at line 110
bool storeMultipleTemplates($inputs)

Validate and store multiple template entries to templates config

Parameters

$inputs

Return Value

bool

at line 148
bool updateTemplate($input)

Validates and updates a template with the given input

Parameters

$input

Return Value

bool

at line 180
boolean destroyTemplate(string $templatePath)

Destroys a template by retrieving current config contents and unsetting the key (templatePath) then saving the updated contents

Parameters

string $templatePath

Return Value

boolean

at line 200
void createVarRules()

Validation rules for registering a new template

Return Value

void

at line 216
bool storeNewVariable(string $templatePath, array $input)

Validate and store a new variable for a given template path

Parameters

string $templatePath
array $input

Return Value

bool