PHP Класс Devise\Templates\TemplatesManager

Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$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

Защищенные свойства (Protected)

Свойство Тип Описание
$ConfigFileManager

Открытые методы

Метод Описание
__construct ( FileManager $ConfigFileManager, Framework $Framework ) 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

Приватные методы

Метод Описание
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]

Описание методов

__construct() публичный Метод

Construct a new template manager
public __construct ( FileManager $ConfigFileManager, Framework $Framework )
$ConfigFileManager Devise\Support\Config\FileManager
$Framework Devise\Support\Framework

createVarRules() публичный Метод

Validation rules for registering a new template
public createVarRules ( ) : void
Результат void

destroyTemplate() публичный Метод

Destroys a template by retrieving current config contents and unsetting the key (templatePath) then saving the updated contents
public destroyTemplate ( string $templatePath ) : boolean
$templatePath string
Результат boolean

registerRules() публичный Метод

Validation rules for registering a new template
public registerRules ( ) : void
Результат void

storeMultipleTemplates() публичный Метод

Validate and store multiple template entries to templates config
public storeMultipleTemplates ( $inputs ) : boolean
Результат boolean

storeNewVariable() публичный Метод

Validate and store a new variable for a given template path
public storeNewVariable ( string $templatePath, array $input ) : boolean
$templatePath string
$input array
Результат boolean

storeTemplate() публичный Метод

Validate and store a template entry to templates config
public storeTemplate ( array $input ) : boolean
$input array
Результат boolean

updateTemplate() публичный Метод

Validates and updates a template with the given input
public updateTemplate ( array $input ) : boolean
$input array
Результат boolean

Описание свойств

$ConfigFileManager защищенное свойство

protected $ConfigFileManager

$errors публичное свойство

Errors are kept in an array and can be used later if validation fails and we want to know why
public array $errors
Результат array

$message публичное свойство

This is a message that we can store why the validation failed
public string $message
Результат string

$messages публичное свойство

Validation messages
public $messages