Devise\Templates\TemplatesManager::destroyTemplate PHP Method

destroyTemplate() public method

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
return boolean
    public function destroyTemplate($templatePath)
    {
        // check if key exists in config, if so unset it
        $configContents = $this->ConfigFileManager->getAppOnly('devise.templates');
        if (isset($configContents[$templatePath])) {
            unset($configContents[$templatePath]);
            return $this->ConfigFileManager->saveToFile($configContents, 'templates');
        }
        $this->errors = 'Failed to remove template, path unrecognized.';
        return false;
    }