Jump to content

Widget - Cannot find class


pRieStaKos

Recommended Posts

Hello,

 

I'm trying to create a widget and when I set the `use` for the class namespaces, I got the error "Fatal error: Cannot find class in...."

 

require_once '../vendor/autoload.php';

use api-vendor\api\client\GetAccountBalance;
use api-vendor\api\configuration\BasicAuthConfiguration;

function widget_get_balance($vars) {
$client = new GetAccountBalance(new BasicAuthConfiguration($USERNAME, $PASSWORD));
}

 

I upload the API for my widget in /vendor folder, I used `autoload.php` in my widget and still getting the same error.

 

Any suggestions ?

Link to comment
Share on other sites

I mean it may delete custom files that is not related to specific package in there, at least this is how it is working with me all the time.

 

from WHMCS v7 Release Notes http://docs.whmcs.com/Version_7.0_Release_Notes

We do not recommend nor support placing your own classes within the WHMCS namespace. WHMCS assumes full authority of the WHMCS namespace and classes directories and offer no guarantees that files you place there will not be overwritten or removed.
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