-
-
Save jakejackson1/903c607beab274619ab19f508d65ce74 to your computer and use it in GitHub Desktop.
PDF Template Configuration file for our Hello World Tutorial, updated for v5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace GFPDF\Templates\Config; | |
use GFPDF\Helper\Helper_Interface_Config; | |
use GFPDF\Helper\Helper_Interface_Setup_TearDown; | |
/* Exit if accessed directly */ | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; | |
} | |
/** | |
* Class Hello_World | |
* | |
* @package GFPDF\Templates\Config | |
* | |
* @Internal See https://gravitypdf.com/documentation/v5/developer-template-configuration-and-image/ for more information about this class | |
*/ | |
class Hello_World implements Helper_Interface_Config, Helper_Interface_Setup_TearDown { | |
/** | |
* Runs when the template is initially installed via the PDF Template Manager | |
* | |
* @Internal Great for installing custom fonts you've shipped with your template. | |
* @Internal Recommend creating the directory structure /install/Hello_World/ for bundled fonts | |
* | |
* @since 1.0 | |
*/ | |
public function setUp() { | |
} | |
/** | |
* Runs when the template is deleted via the PDF Template Manager | |
* | |
* @Internal Great for cleaning up any additional directories | |
* | |
* @since 1.0 | |
*/ | |
public function tearDown() { | |
} | |
/** | |
* Return the templates configuration structure which control what extra fields will be shown in the "Template" tab when configuring a form's PDF. | |
* | |
* @return array The array, split into core components and custom fields | |
* | |
* @since 1.0 | |
*/ | |
public function configuration() { | |
return [ | |
/* Enable core fields */ | |
'core' => [ | |
], | |
/* Create custom fields to control the look and feel of a template */ | |
'fields' => [ | |
], | |
]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment