Property | Type | Description | |
---|---|---|---|
$errors | array | Errors are kept in an array and can be used later if validation fails and we want to know why | |
$message | string | This is a message that we can store why the validation failed | |
$messages | Validation messages |
Property | Type | Description | |
---|---|---|---|
$ConfigFileManager |
Method | Description | |
---|---|---|
__construct ( |
Construct a new template manager | |
createVarRules ( ) : void | Validation rules for registering a new template | |
destroyTemplate ( string $templatePath ) : boolean | Destroys a template by retrieving current config contents and unsetting the key (templatePath) then saving the updated contents | |
registerRules ( ) : void | Validation rules for registering a new template | |
storeMultipleTemplates ( $inputs ) : boolean | Validate and store multiple template entries to templates config | |
storeNewVariable ( string $templatePath, array $input ) : boolean | Validate and store a new variable for a given template path | |
storeTemplate ( array $input ) : boolean | Validate and store a template entry to templates config | |
updateTemplate ( array $input ) : boolean | Validates and updates a template with the given input |
Method | Description | |
---|---|---|
addNewVariable ( array $configContents, string $templatePath, array $input ) : array | adds a brand new variable to the location specified in the form | |
castBooleans ( &$varData ) : void | Takes care of casting 'true/false' strings to data type boolean | |
copyExistingVariable ( array $configContents, string $templatePath, $path ) : array | takes an existing var path and copies it to the template path | |
prepVarsAndParams ( array $varInput ) : array | Constructs formatted vars array ready for saving to the templates config file | |
processAndMergeNewVars ( &$input ) : void | Processes input['template'] data and unsets any newVars array elements which have empty string values. After processing newVars data, its merged together with template vars array | |
removeEmptyParams ( array $arr ) : array | Checks for any array keys with empty values and removes/unsets key(s) from array | |
validateInputVars ( array $input ) : boolean | Validate input[template][vars] |
public __construct ( |
||
$ConfigFileManager | ||
$Framework |
public createVarRules ( ) : void | ||
return | void |
public destroyTemplate ( string $templatePath ) : boolean | ||
$templatePath | string | |
return | boolean |
public registerRules ( ) : void | ||
return | void |
public storeMultipleTemplates ( $inputs ) : boolean | ||
return | boolean |
public storeTemplate ( array $input ) : boolean | ||
$input | array | |
return | boolean |
public updateTemplate ( array $input ) : boolean | ||
$input | array | |
return | boolean |
public array $errors | ||
return | array |
public string $message | ||
return | string |