组织由PHP,Smarty,JavaScript,MySQL驱动的网站的文件 [英] Organizing files of a website powered by PHP, Smarty, JavaScript, MySQL
问题描述
我正在编写一个由
PHP,Smarty,JavaScript,CSS,MySQL提供支持的Web应用程序。
I am writing an web application powered by PHP, Smarty, JavaScript, CSS, MySQL.
将会有一些类通过应用程序。
将有一些脚本将使用这些类。
There will be some classes, which will be used through out the application. There will be some scripts which will use those classes.
任何好的文章,教程,架构如何组织网站的文件?
Any good article, tutorial, architecture on how to organize files for a web site?
PS它应该包含如何组织所有的文件(PHP,JavaScript,CSS,模板文件。)
P.S. It should contain how to organize all the files (PHP, JavaScript, CSS, template files.)
推荐答案
模板文件不能通过Web服务器直接访问。
Just remember PHP libraries and template files should not be directly accessible over the web server.
您可以创建类名称为My_Db_Table并加载 __ autoload 。
You can make class names like My_Db_Table and load them with __autoload.
/project
- /config
- /html
- - /css
- - /images
- - /js
- - /subdirs for php files unless you use apache mod_rewrite or similar
- - index.php
- - otherfiles.php
- /lib
- - /My
- - - /Db
- - - - Table.php
- /templates
- /functions
- /scripts
这篇关于组织由PHP,Smarty,JavaScript,MySQL驱动的网站的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!