I'm using Doctrine DBAL to connect to my database. I created a custom class to act as a kind of Controller (it's pretty much just for retrieving data). I'm using composer's autoload to load this class, so I place it in /src/Digital/Data.php (using PSR-0). Everything works fine, but now I need to use Doctrine in /src/Digital/Data.php, do I have to put require 'vendor/autoload.php';in it? In my index file I also have this (to call the Data class). Which is the proper way to use Doctrine in my custom class?
Add a comment
|