TemplatesManager
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 a new template manager
Validation rules for registering a new template
Validate and store a template entry to templates config
Validate and store multiple template entries to templates config
Validates and updates a template with the given input
Destroys a template by retrieving current config contents and unsetting the key (templatePath) then saving the updated contents
Validation rules for registering a new template
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
at line 68
void
registerRules()
Validation rules for registering a new template
at line 82
bool
storeTemplate(array $input)
Validate and store a template entry to templates config
at line 110
bool
storeMultipleTemplates($inputs)
Validate and store multiple template entries to templates config
at line 148
bool
updateTemplate($input)
Validates and updates a template with the given input
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
at line 200
void
createVarRules()
Validation rules for registering a new template
at line 216
bool
storeNewVariable(string $templatePath, array $input)
Validate and store a new variable for a given template path