PHP, Smarty, JavaScript, MySQL로 구동되는 웹 사이트 파일 구성
-
10-07-2019 - |
문제
PHP, Smarty, JavaScript, CSS, MySQL로 구동되는 웹 응용 프로그램을 작성하고 있습니다.
일부 클래스가 있으며,이 클래스는 응용 프로그램을 통해 사용됩니다. 해당 클래스를 사용할 스크립트가 있습니다.
웹 사이트의 파일을 구성하는 방법에 대한 좋은 기사, 튜토리얼, 아키텍처가 있습니까?
추신 : 모든 파일 (PHP, JavaScript, CSS, 템플릿 파일)을 구성하는 방법이 포함되어야합니다.)
해결책
PHP 라이브러리와 템플릿 파일은 웹 서버를 통해 직접 액세스 할 수있어서는 안됩니다.
my_db_table과 같은 클래스 이름을 만들고로드 할 수 있습니다. __ afoload.
/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
다른 팁
다음은 Smarty를 사용한 PHP 프로젝트에 대한 두 가지 좋은 기사와 파일 구조를 설정하는 방법입니다.
http://codepoets.co.uk/php5_application_directory_structure_ruby_on_rails
http://www.edit-x.com/editx-support-articles.php?s=&c=21&d=48&e=&f=&g=&a=1112&w=2
매우 기본적인 폴더 레이아웃 :
root
|
|- htdocs # apache documentroot (i.e. index.php etc.) here
| |
| |- styles # css here
| |
| |- images
|
|- application # classes etc. here
|
|- vendor
| |
| |- smarty # smarty library files
제휴하지 않습니다 StackOverflow