Is there a package services in the MVC standard?

Asked

Viewed 69 times

1

Is there a service package in the MVC standard? It would be an MVCS?

For example, I have a Connectionfactory class - which serves to connect to the database. That would be a service. Where do I put this in the MVC pattern? It would be in the Controller package or create a new package called Services?

Another question: and the exceptions, in which package I put?

1 answer

0


Usually this type of service is in a folder called config, or app->config. The exceptions, which in my view would be files from a framework for example, would become vendor.

This type of model is widely used by frameworks such as Zend and Laravel (PHP Frameworks).

Folder structure of Zend:

-config
     -autoload
-data
     -cache
-module
     -Application
-public
     -css
     -js
     -image
-vendor
     -zendframework
     -bin

The config folder is responsible for the configuration files of the entire application. The data folder, for the files saved in the application. Module keeps the files responsible for the mvc of each module of the application. Public is the folder responsible for public acquisitions, much of these files used in the views. And vendor, where is the framework and various.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.