Skip to content

Instantly share code, notes, and snippets.

@jakejackson1 jakejackson1/hello-word.php Secret
Created Sep 21, 2018

Embed
What would you like to do?
PDF Template Configuration file for our Hello World Tutorial, updated for v5
<?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
You can’t perform that action at this time.