php项目中的文件夹结构

时间:2016-03-09 12:44:28

标签: php html directory-structure

我正在尝试重组我的项目,因为我的所有文件都在铺设。但是文件夹结构看起来还不错,还是我做错了什么?

public_html是公共站点,用户未登录 user_html us用户登录的私人网站

我希望我不要把它放在错误的类别中。如果我道歉,请告诉我。

文件夹结构:
 Folder Structure

2 个答案:

答案 0 :(得分:1)

即使您没有使用Composer进行自动加载,PSR-4目录结构也非常好,如果您使用它并希望稍后添加自动加载,您可以这样做。我想大多数框架都会使用它。

我使用的总体布局是:

app_name -> general dir
|  
|____App -> where your app goes
|    |___app_name -> name of application
|    |  |___ models -> these can be whatever you want
|    |  |___controllers
|    |
|    |____templates -> where I put my php/html/twig
|    |
|    |____css -> application specific
|    |    |
|    |    |____app.css
|    |
|    |____js -> application specific
|         | 
|         |____app.js
|
|____Vendor
|    |____php -> php libs
|    |____js  -> frontend css js libs
|
|____Tests
|    |____modelTest
|
|____.git
|____composer.json 
|____bower.json
|____index.php

答案 1 :(得分:0)

看看codeigniter目录结构。

更好的方法是使用php mvc框架。

相关问题