Craft\FormBuilder2_TemplateService::getTemplateByName PHP Method

getTemplateByName() public method

Get template file by its name
public getTemplateByName ( string $templateName ) : array
$templateName string Template file name
return array Returns template file information
    public function getTemplateByName($templateName)
    {
        $template = [];
        $path = craft()->path->getPluginsPath() . 'formbuilder2/templates/email/templates/' . $templateName;
        $file = IOHelper::getFile($path);
        $template = ['fileName' => $file->getFileName(false), 'fileOriginalName' => $file->getFileName(), 'fileNameCleaned' => IOHelper::cleanFilename(IOHelper::getFileName($file->getRealPath(), false)), 'fileExtension' => $file->getExtension(), 'filePath' => $file->getRealPath(), 'fileContents' => $file->getContents()];
        return $template;
    }