PHP code example of akerbel / whmcs-easy-addons

1. Go to this page and download the library: Download akerbel/whmcs-easy-addons library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

akerbel / whmcs-easy-addons example snippets


function EasyAddonsSkeleton_output($vars) {
	global $module;
    

namespace EasyAddonsSkeleton;
global $module;
ntroller($vars);
$EasyAddonsSkeleton->run();

namespace EasyAddonsSkeleton;

use whmcsEasyAddons;

class EasyAddonsSkeletonController extends whmcsEasyAddons\PageController {
    // This tab will be chosen by dafault
    public $action = 'firsttab';
	
    // This is array of your tabs and their names.
	public $menu = array(
		'First Tab' => 'firsttab',
        'Second Tab' => 'secondtab',
	);
	
	public function firsttabAction(){
		
        // Your code for "First tab"
		
	}
    
    public function secondtabAction(){
		
        // Your code for "Second tab"
        
	}
}

$this->view->assign('smarty_variable', $your_php_variable);

    $list = new whmcsEasyAddons\ItemList(
    
        // SQL params array. Read more in ItemList.php
        array(
            'SELECT' => '*',
            'FROM' => 'tblmodulelog',
        ),
        
        // Filters array. Read more in ItemList.php . Optional.
        array(
            array(
                'name' => 'module', 'value' => $_GET['filter']['module'], 'description' => 'module'
            ),
            array(
                'name' => 'action', 'value' => $_GET['filter']['action'], 'description' => 'action'
            ),
            array(
                'name' => 'request', 'value' => $_GET['filter']['request'], 'description' => 'request', 'type' => 'LIKE'
            ),
            array(
                'name' => 'response', 'value' => $_GET['filter']['response'], 'description' => 'response', 'type' => 'LIKE'
            ),
        ), 
        
        // Paginators type. Read more in a changelog for v1.2 . Optional.
        'dafault'
    );
    $this->view->assign('result', $list->result);
    $this->view->assign('paginator', $list->paginator);
    $this->view->assign('tablehead', $list->tablehead);
    $this->view->assign('filter', $list->filter);
bash
# Install Composer
curl -sS https://getcomposer.org/installer | php
bash
curl -sS https://getcomposer.org/installer | php