Devise\Templates\TemplatesManager::storeNewVariable PHP Method

storeNewVariable() public method

Validate and store a new variable for a given template path
public storeNewVariable ( string $templatePath, array $input ) : boolean
$templatePath string
$input array
return boolean
    public function storeNewVariable($templatePath, $input)
    {
        $validator = $this->Validator->make($input, $this->createVarRules(), $this->messages);
        $copyVar = isset($input['copy_var']) && $input['copy_var'] !== '0' ? $input['copy_var'] : false;
        if ($copyVar || $validator->passes()) {
            $configContents = $this->ConfigFileManager->getAppOnly('devise.templates');
            if ($copyVar) {
                $configContents = $this->copyExistingVariable($configContents, $templatePath, $copyVar);
            } else {
                $configContents = $this->addNewVariable($configContents, $templatePath, $input);
            }
            return $this->ConfigFileManager->saveToFile($configContents, 'templates');
        }
        $this->errors = $validator->errors()->all();
        return false;
    }