MVC Folder Structure

5

Hello. I'm trying to build my own application using the MVC standard. I understand the separation of each item (Model, View and Controller). However, I want to do some sort of separation between Front-end and Back-end, since some Backend Controllers will have the same name as Frontend.

I can not see something that is simpler to create this restriction. Anyone have ideas how?

    
asked by anonymous 08.09.2015 / 20:04

1 answer

3

In my experience, the problem of this structuring always occurs with views, since 50 views can use only 1 controller and 1 model, so my suggestion and how to work with my own framework, is to separate just the views getting more or less so, based on its structure:

app
   controllers
   models
   views
      admin (Backend)
         produtos
            add_produtos.phtml
            edit_produtos.phtml
            list_produtos.phtml
            del_produtos.phtml
         usuarios
            add_usuarios.phtml
            edit_usuarios.phtml
            list_usuarios.phtml
            del_usuarios.phtml     
      site (Frontend)
            home.phtml
            empresa.phtml
            clientes.phtml
            contato.phtml
    
18.10.2015 / 00:23