Salamander
Salamander 1.0
Slim을 기반으로 간단하고 빠른 PHP 프레임 워크
1. 웹 루트 디렉토리 (예 : nginx)를 구성하고 index.php 파일로 다시 작성하도록 요청합니다.
root D:/your_web_project/Salamander/public;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ .php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
2. PHP 종속성을 설치하십시오
composer install
app [application backend directory]
├── Controller [controller directory]
├── Library [Library folder]
├── Middleware [Middleware folder]
├── Service [Logic business folder]
├── settings [Slim settings folder]
|── dependencies.php [Slim dependencies settings folder]
|── middleware.php [Slim middleware settings folder]
├── Tool [Tool folder]
├── template [template folder]
├── config.php [config file]
├── functions.php [common functions file]
├── ini.php [web init file]
├── routes.php [routes file]
assets [frontend source directory]
public [web root directory]
├── index.php [entrance php script file]
composer.json [composer file]
README.md [readme file]
라우팅 분배 및 종속성 주입 Slim , Routes.php 세트 요청 라우팅, 설정/종속성 .PHP 세트 글로벌 종속성
제어 계층 :베이스 컨트롤러 클래스를 상속하기 위해 클래스를 작성하면 클래스 메소드에 세 가지 매개 변수가 주입됩니다.
비즈니스 로직 계층 :베이스 서비스 클래스를 상속하기 위해 클래스를 작성한 다음 DB (DB 속성을 통해)를 작동시킨 다음 다른 종속성을 호출하여 비즈니스 로직을 구현합니다.