Jump to content

getSingleTPLOutput() custom page


Recommended Posts

Hello everyone,

 

I am currently trying to find a method for returning only select template files, for instance header.tpl

I have noticed that WHMCS_ClientArea::output() and ClientArea::output() cause execution to stop (exit()??)

 

So after further trying I have found that I can get individual templates compiled using ClientArea::getSingleTPLOutput() and WHMCS_ClientArea::getSingleTPLOutput();

However, fetching a TPL file with these methods leaves a lot of things undefined.

 

Is there a list of templatevars that I can set to make these pages operate properly, similar to how the output method works? I have compared the two side by side and output() does perform some additional steps that I am missing, it has more defined classes/included files and a filled out templatevars array.

 

here is my current work:

 

<?php
use WHMCS\ClientArea;
use WHMCS\Database\Capsule;


define('CLIENTAREA', true);

require __DIR__ . '/init.php';
require __DIR__ . "/includes/clientfunctions.php";
require __DIR__ . "/includes/gatewayfunctions.php";
require __DIR__ . "/includes/ccfunctions.php";
require __DIR__ . "/includes/domainfunctions.php";
require __DIR__ . "/includes/registrarfunctions.php";
require __DIR__ . "/includes/customfieldfunctions.php";
require __DIR__ . "/includes/invoicefunctions.php";
require __DIR__ . "/includes/configoptionsfunctions.php";

$ca = new ClientArea();


echo $ca->getSingleTPLOutput('/templates/six/wp_header.tpl', $ca->getTemplateVars());

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated