4

i have a directory structure like this :

Directory

and this is my composer.json :

 {
    "autoload": {
        "psr-4": {
            "travelo_conf\\": "config/",
            "travelo_url\\": "url/"
        }
    }
}

now I'm trying to extending my Api Class with Hotel Class

this is my ApiConfig Class :

namespace travelo_conf\config ;

    class ApiConfig {}

and this is my hotel class :

<?php 

namespace travelo_url\hotelbedsUrl ;

require '../vendor/autoload.php';

use travelo_conf\config\ApiConfig ;


     class Hotels extends ApiConfig 
        {

            function __construct()
            {
                parent::__construct() ;

            }
    }

and I got an error like this :

Fatal error: Class 'travelo_conf\config\ApiConfig' not found in /var/www/html/4travelo_Beta/url/getHotelUrl.php on line 9

can someone explain to me why ?

Jeff Puckett
  • 37,464
  • 17
  • 118
  • 167
Herdy
  • 179
  • 1
  • 2
  • 16

1 Answers1

2

seems like it should be travelo_conf\ApiConfig rather than travelo_conf\config\ApiConfig

Fu Xu
  • 766
  • 2
  • 6
  • 21