Reputation: 372
I have a class file named Notes.php .It does have a namespace
and when I do require_once
it gives me a Warning Required file not found where as the url is correct and also. Below is the Class File
Directory tree is:
Class
Notes
Notes.php
Database
Db.php
Below is the class code
#Declare Namespace for the Notes class
namespace Dashboard\Api\Notes;
require_once '../Database/Db.php';
use Dashboard\Api\Database\Db;
class Notes {
# Set Protected Properties
protected $_db;
public $username;
function __construct () {
$this->_db = Db::getInstance();
}
public function getNotes() {
$query = "SELECT * FROM notes";
$result = $this->_db->query($query);
}
}
Upvotes: 0
Views: 41