public function getTemplateByPath($templatePath)
{
$configData = $this->Config->get('devise.templates');
if (isset($configData[$templatePath])) {
$template = $configData[$templatePath];
$templateSource = $this->getTemplateSourceByPath($templatePath);
// if extends is empty/not set, retrieve it from blade
if (empty($template['extends'])) {
$template['extends'] = $this->getTemplateExtends($templateSource);
}
// retrieve and set any vars found in source of config
$template['vars'] = $this->getVarsFromSource($template, $templateSource);
// split vars array into vars and newVars keys
$template = $this->splitVarsAndNewVars($template);
return $template;
} else {
throw new DeviseTemplateNotFoundException('"' . $templatePath . '" was not found in templates config. Please check the devise.templates.php and ensure this path exists.');
}
}