-1

有人可以帮助我解决使用“命名空间”、“使用”(php v5.3 或更高版本)在同一项目(调用类)中引用 php 文件的问题[我的屏幕截图][ http://i.imgur.com/ 6GC4UUK.png?1]

致命错误:第 73 行的 C:\root\zohocrm-master\src\Zoho\CRM\index.php 中找不到类 'Zoho\CRM\Common\HttpClientInterface'

  <?php namespace Zoho\CRM;

    use Zoho\CRM\Common\HttpClientInterface;
    use Zoho\CRM\Common\FactoryInterface;
    use Zoho\CRM\Request\HttpClient;
    use Zoho\CRM\Request\Factory;
    use Zoho\CRM\Wrapper\Element;    
                    .
                    .
                    .

public function __construct($authtoken, HttpClientInterface $client =null , FactoryInterface $factory = null )
        {
            $this->authtoken = $authtoken;
            // Only XML format is supported for the time being
            $this->format = 'xml'; 


             $this->client = new HttpClientInterface();
            $this->factory = $factory ;
            $this->module = "Leads";
            return $this;
        }
4

1 回答 1

0

Robinson,您正在从这个位置调用类“Zoho\CRM\Common**HttpClientInterface**”:“C:\root\zohocrm-master\src\Zoho\CRM**index.php**”。

这意味着您尝试使用命名空间的方式不正确。

请记住,如果您这样做:

use App\namespace\class_name

这意味着您的类“class_name”必须位于这样的文件夹中:App/namespace/。所以当你调用 use 时,很好地定义你的类的路径。

于 2014-09-12T23:33:24.313 回答