我建议你研究一个框架的目录结构,比如symfony2或yii。
这是我为我选择的:
public_html/ (for public files) (should be public, place only index.php in here)
public_html/css/
public_html/images
public_html/js (for your js files, or custom generated ones)
lib/ (for my libs) (should be private)
lib/vendor/ (for 3rd party libs)
application/ (for the whole app) (should be private)
application/class (classes that make the app work such as mainApp, Controller, Model, View, etc...)
application/class/model (all the models)
application/class/view (all the views)
application/class/view/html (templates used by the views)
application/class/controller (all controllers)
application/class/helper (helper functions)
application/class/lib (libs that you develop for the application)
application/template (layout and/or templates for the application)
application/conf (config files)
application/log (log files)
application/cron (scheduled jobs)
application/database (for database migration scripts)
...
您还可以使用文件命名约定,例如:YourClassName.class.php用于 clases,YourView.phtml 用于视图等。检查一个框架,你将学习如何很好地构建和应用程序。