Custom Pages

WHMCS Custom Pages

To create a custom page for WHMCS, two files need to be created, a PHP file and a Smarty TPL file. The PHP file must be created in the root of the WHMCS installation directory, and the .TPL file must be created in WHMCS_ROOT/templates/template_name.

For a more detailed example, e.g. a page that does authentication and that displays menus, see Reference

PHP Example

<?php

use WHMCS\ClientArea;
use WHMCS\Database\Capsule;

define('CLIENTAREA', true);

require __DIR__ . '/init.php';

$ca = new ClientArea();

$ca->setPageTitle('Page Title');

$ca->addToBreadCrumb('index.php', Lang::trans('globalsystemname'));
$ca->addToBreadCrumb('smart_template_file.php', 'Custom Page Name');

$ca->initPage();

$ca->setTemplate('mypage');

$ca->output();

Reference