leon723/chestnut

Chestnut PHP Framework

0.9.18 2016-07-07 08:50 UTC

README

Chestnut PHP framework

安装

通过 composer 安装

composer required "leon723/chestnut:^0.9.0"

在项目根目录创建 index.php 并输入以下内容:

<?php
require_once "../vendor/autoload.php";

$app = new Chestnut\Foundation\Application(
    realpath("../")
);

Route::group(['namespace' => 'App\Controllers'], function () {
    require '../app/route.php';
});

$app->run();

美化链接

Apache

Options +FollowSymLinks
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

Nginx

location / {
    try_files $uri $uri/ /index.php?$query_string;
}