无法在同一个项目中加载PHP类

时间:2014-09-15 19:00:11

标签: php html class import autoload

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

Zoho\
 CRM\
  Common\
      -HttpClientInterface.php
  Config\
  Entities\
  Exception\
  Request\
  Wrapper\
  index.php

我已经阅读过有关自动加载课程的信息,但我并不是很好......

Fatal error: Class 'Zoho\CRM\Common\HttpClientInterface' not found in C:\root\zohocrm-master\src\Zoho\CRM\index.php on line 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;
            }

这是我的班级档案:

<?php namespace Zoho\CRM\Common;

/**
 * Common interface for Http clients
 *
 * @package Zoho\CRM\Common
 * @version 1.0.0
 */
interface HttpClientInterface
{
  /**
   * Performs POST request.
   *
   * @param string $uri Direction to make the post
   * @param string $postBody Post data
   */
  public function post($uri, $postBody);
}

0 个答案:

没有答案