I have folder structure like:
includes/
libraries/
Classes/
Contact/
Contact.php
ContactController.php
admin/
controllers/
contact/
edit.php
Contact.php is my class that file that I'm trying to use. The file contains.
<?php
namespace Classes;
class Contact {
function __construct() {
die('here');
}
}
I have my composer.json file like:
{
"autoload": {
"psr-4": {
"Classes\\": "includes/libraries/Classes/"
}
},
}
The file I'm trying to use the Contact class in is edit.php
within the admin/controllers/contact/
folder. My edit.php
file is like:
<?php
use Classes\Contact;
$contact = new Contact();
var_dump($contact);
This file has the vendor/autoload.php
file included, yet I can't seem to get it to use the class?