What is the "right" folder structure for a PHP MVC project using Vuejs?

Asked

Viewed 535 times

0

I know there is no absolute folder structure, but if there is a common preference, it already clears up on the way.

I usually use something like:

-app (arquivos .php)
   -model
   -view
   -control
-public
   -js
   -css
   -images
   -index.php

I have searched several places but found no example of PHP MVC application with Vuejs. In which folder I "should/can" start (vue-cli init ...) my project Vue?

2 answers

-1


I don’t think you should worry so much about it since you’re not using any other framework together. For example if you use vuejs with symfony it will put inside the directory . /assests/vuejs or . /Assets/somethings, in the case of the Variable will be inside . /Resources/Assets/js. For example:

.
├── laravel
│   ├── app
│   ├── public
│   └── resources
│       └── assets
│           └── vuejs
└── symfony
    ├── assets
    │   └── vuejs
    ├── public
    └── src

So if you want to follow the +- the same concept of the guys will look something like this:

.
├── app
│   ├── control
│   ├── model
│   └── view
├── assets
│   └── vuejs
└── public
    ├── css
    ├── images
    └── js

here has an example using with symfony and here also.

With Larable.

But if your php application is separated from vuejs only by communicating by a restful api for example, it would be best to leave them totally separate, that way:

.
├── backend
│   ├── app
│   │   ├── control
│   │   ├── model
│   │   └── view
│   └── public
│       ├── css
│       ├── images
│       └── js
└── frontend
    └── vuejs

-2

Each Framework has its skeleton. If it is a SPA application for example you can run the back end on one server and the front end on another. Doesn’t necessarily need to be inside the skeleton...

Browser other questions tagged

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