title: How to organise components of a no framework project?
body: <p><strong>SHORT VERION:</strong> Where is the common place to store the controllers for dependencies in PHP?
  <br><br><br>
  <strong>LONG VERSION:</strong> I need to create a project at a high quality, coming from a framework background my knowledge on directory structure is a bit rusty and I would like some help.</p>
  
  <p>Current Directory Structure: <a href="https://i.imgur.com/sxowces.png" rel="nofollow noreferrer">https://i.imgur.com/sxowces.png</a></p>
  
  <p>I use the "controllers" driectory for controllers as callbacks for my routes. Each HTML page I create I assign a controller to its route. I ran into a problem when I had to create a "controller" for a dependencies, for example the Twig template engine. From past experience I've learnt that you shouldn't directly call to the twig library from a created instance, you should create a class that holds an instance and make calls through that class, am I correct?</p>
  
  <p>This brings a new problem, I don't know how to structure this. I'm not sure if their called controllers or not, but where do I place these in my project directory structure? What is the common practice?</p>
  
  <p>Putting them inside the controllers directory seems messy, as that's reserved for page controllers. Coming from a Laravel background, I've never had to do this. So my questions are, 'Is my current directory structure okay?', and 'Where do the "controllers" for dependencies go?' ?</p>