Development Guides Home >> Quickstart Development Guide
This tutorial uses PHP to create a new WHM interface. The examples below create a new interface that integrates seamlessly with the look and feel of the main WHM interface.
To begin a PHP plugin interface, add the following header:
<?php
require_once('/usr/local/cpanel/php/WHM.php');
?>This header accesses WHM's PHP library in the /usr/local/cpanel/php/WHM.php file.
You can use two different methods to retrieve the WHM header:
- The code examples below only use this method to display the WHM header.
- When you develop WHM interfaces in PHP, you cannot specify values for other header parameters. To modify these parameters, you must use Template Toolkit to develop your interface.
To directly display WHM's header, your code should resemble the following example:
<?php
require_once('/usr/local/cpanel/php/WHM.php');
WHM::header('Example Plugin Interface',0,0);
?>The WHM::header('Example Plugin Interface',0,0); line passes the following values:
- The first passed value sets the interface's title.
- The second passed value sets the
skipsupportparameter to0. - The third passed value sets the
skipheaderparameter to0.
For more information and additional options, read our Guide to WHM Plugins - Interfaces documentation.
- The code examples below do not use this method to display the WHM header.
- When you develop WHM interfaces in PHP, you cannot specify values for other header parameters. To modify these parameters, you must use Template Toolkit to develop your interface
To retrieve WHM's header as a string, your code should resemble the following example:
<?php
require_once('/usr/local/cpanel/php/WHM.php');
$headerString = WHM::getHeaderString("Example Plugin Interface",0,0);
echo($headerString);
?>The $headerString = WHM::getHeaderString("Example Plugin Interface",0,0); line passes the following values:
- The first passed value sets the interface's title.
- The second passed value sets the
skipsupportparameter to0. - The third passed value sets the
skipheaderparameter to0.
For more information and additional options, read our Guide to WHM Plugins - Interfaces documentation.
Add the desired interface contents below the header.
<?php
require_once('/usr/local/cpanel/php/WHM.php');
WHM::header('Example Plugin Interface',0,0);
?>
// Add content here.You can use two different methods to retrieve the WHM footer:
To directly display WHM's footer, your code should resemble the following example:
<?php
require_once('/usr/local/cpanel/php/WHM.php');
WHM::header('Example Plugin Interface',0,0);
?>
// Add content here.
<?php
WHM::footer();
?>For more information, read our Guide to WHM Plugins - Interfaces documentation.
To retrieve WHM's footer as a string, your code should resemble the following example:
<?php
require_once('/usr/local/cpanel/php/WHM.php');
WHM::header('Example Plugin Interface',0,0);
?>
// Add content here.
<?php
$footerString = WHM::getFooterString();
echo($footerString);
?>For more information, read our Guide to WHM Plugins - Interfaces documentation.