-1

「namespace」、「use」(php v5.3以降)を使用して同じプロジェクト内のphpファイルを参照する(クラスを呼び出す)問題について、誰かが私を助けることができます[私のスクリーンショット] [ http://i.imgur.com/ 6GC4UUK.png?1]

致命的なエラー: クラス 'Zoho\CRM\Common\HttpClientInterface' が C:\root\zohocrm-master\src\Zoho\CRM\index.php の 73 行目に見つかりません

  <?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

ロビンソンさん、あなたはクラス「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 に答える