Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test functions

process_template()

Description

Function used to process a template

Process template and bind any placeholders. The template should contain (if needed) PHP statements which will
will be processed through this function.

Parameters

ColumnTypeDefaultDescription
$template_path string The full path to the location of the template (as returned by get_template_path())
$bind_placeholders array array A map of all the values that are meant to replace any placeholders found in the template

Return

string

Location

include/pdf_functions.php lines 261 to 282

Definition

 
function process_template($template_path, array $bind_placeholders = array())
    {
    global 
$applicationname$baseurl$baseurl_short$storagedir$lang$linkedheaderimgsrc;
    global 
$contact_sheet_date_include_time$contact_sheet_date_wordy$pdf_properties;

    
// General placeholders available to templates
    
$applicationname $bind_placeholders['applicationname'] ?? $applicationname;
    
$baseurl         $bind_placeholders['baseurl'] ?? $baseurl;
    
$baseurl_short   $bind_placeholders['baseurl_short'] ?? $baseurl_short;
    
$filestore       $bind_placeholders['filestore'] ?? $storagedir;
    
$lang            $bind_placeholders['lang'] ?? $lang;
    
$date            $bind_placeholders['date'] ?? nicedate(date('Y-m-d H:i:s'), $contact_sheet_date_include_time$contact_sheet_date_wordy);

    
// Sometimes, HTML2PDF complains about headers being already sent
    
ob_end_clean();

    
// At this point we shoud have all the placeholders we need to render the template nicely
    
ob_start();
    include 
$template_path;

    return 
ob_get_clean();
    }

This article was last updated 4th December 2024 08:35 Europe/London time based on the source file dated 27th November 2024 15:30 Europe/London time.