PHP 클래스 Devise\Templates\TemplatesManager

파일 보기 프로젝트 열기: devisephp/cms

공개 프로퍼티들

프로퍼티 타입 설명
$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

보호된 프로퍼티들

프로퍼티 타입 설명
$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