Fehler bei eigener Seite erstellen

  • Hallo,


    ich verzweifle mittlerweile, wollte eine eigene Seite im Clientbereich erstellen und habe das laut Anleitung von WHMCS (Creating Pages - WHMCS Developer Documentation) gemacht.


    Jedoch kommt immer wieder die Fehlermeldung:



    So sieht meine mypage.php aus:


    <?php


    use WHMCS\ClientArea;

    use WHMCS\Database\Capsule;


    define('CLIENTAREA', true);


    require __DIR__ . '/init.php';


    $ca = new ClientArea();


    $ca->setPageTitle('Your Page Title Goes Here');


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

    $ca->addToBreadCrumb('mypage.php', 'Your Custom Page Name');


    $ca->initPage();


    //$ca->requireLogin(); // Uncomment this line to require a login to access this page


    // To assign variables to the template system use the following syntax.

    // These can then be referenced using {$variablename} in the template.


    //$ca->assign('variablename', $value);


    // Check login status

    if ($ca->isLoggedIn()) {


    /**

    * User is logged in - put any code you like here

    *

    * Here's an example to get the currently logged in clients first name

    */


    $clientName = Capsule::table('tblclients')

    ->where('id', '=', $ca->getUserID())->pluck('firstname');

    // 'pluck' was renamed within WHMCS 7.0. Replace it with 'value' instead.

    // ->where('id', '=', $ca->getUserID())->value('firstname');

    $ca->assign('clientname', $clientName);


    } else {


    // User is not logged in

    $ca->assign('clientname', 'Random User');


    }


    /**

    * Set a context for sidebars

    *

    * @link http://docs.whmcs.com/editing_client_area_menus#context

    */

    Menu::addContext();


    /**

    * Setup the primary and secondary sidebars

    *

    * @link http://docs.whmcs.com/editing_client_area_menus#context

    */

    Menu::primarySidebar('announcementList');

    Menu::secondarySidebar('announcementList');


    # Define the template filename to be used without the .tpl extension


    $ca->setTemplate('mypage');


    $ca->output();



    Und so meine Template-Datei welche im Template-Ordner liegt:



    Kann mir jemand sagen was ich hier falsch gemacht habe?


    Danke im Voraus.


    LG

    Daniel