Organizing files of a website powered by PHP, Smarty, JavaScript, MySQL

后端 未结 3 1179
执念已碎
执念已碎 2020-12-17 07:26

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 wi

3条回答
  •  执笔经年
    2020-12-17 07:59

    Just remember PHP libraries and template files should not be directly accessible over the web server.

    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
    

提交回复
热议问题