title: PHP MVC file structure
body: <p>How should I structure directories in mvc design pattern in PHP so that I could be able to use the same model and controllers in 'backend' and 'frontend' with different views.</p>
  
  <p><strong>WHAT I HAVE DONE</strong></p>
  
  <p>I am trying to build a website using PHP as server side language and dediced to use MVC design pattern. In my localhost (xampp) I created folder structure like below:</p>
  
  <pre><code>htdocs -- mvc 
             |---- controllers
             |---- models
             |---- views
             |---- library
             |---- system-admin (backend)
                 |___ controllers
                 |___ models
                 |___ views
                 |___ index.php (single entry point - backend)
                 |___ .htaccess
             |---- index.php (single entry point - frontend)
             |---- .htaccess
  </code></pre>
  
  <p>I tried to implement basic 'login-system' and created 'Login_Controller' and 'Login_Model' Files. </p>
  
  <p><strong>I GET CONFUSED</strong> </p>
  
  <p>How can I be able to use 'Login_Controller' and 'Login_Model' from both  <code>backend</code> and <code>frontend</code> while using seperate views for each. What do I mean is , the url for admins to login will be :
  <code>http://localhost/mvc/system-admin/login/</code> and the url for site users to login will be :
  <code>http://localhost/mvc/login/</code>. </p>
  
  <p>I am designing the <code>backend</code> using <code>twitter-bootstrap</code> framework but the design of <code>frontend</code> will be done by some other who may not use the framework that I have used so I need different views. Both <code>backend</code> and <code>frontend</code> will share the files from <code>library</code>. Some Models and Controllers are also shared (such as Login_Model and Login_Controller) and some are not (such as Dashboard_Model and Dashboard_Contoller will be used only in backend I think) . </p>
  
  <p><strong>WHAT I NEED</strong></p>
  
  <p>I need some guid on structuring my directories and judgement on my current file structure. I have never used any design pattern (except <code>singleton</code> :-) ) nor any PHP frameworks so I am not able to make any decision on how to structure files.</p>