pixlmint/nacho
最新稳定版本:1.6.17
Composer 安装命令:
composer require pixlmint/nacho
包简介
My own Lightweight PHP Framework
README 文档
README
About
This is my own little PHP Framework, slowly developed as I need functionality in my own projects.
Installation
composer require pixlmint/nacho- Copy
public/index.phpto your root directory
First Endpoint
- Add a
config.phpfile under/configwith the following content:
<?php return [ 'routes' => [ [ "route" => "/", "controller" => App\Controllers\HomeController, "function" => "index" ], ], ];
- Create a file
HomeController.phpundersrc/Controllers, add the following Content:
<?php namespace App\Controllers; use Nacho\Controllers\AbstractControllers; use Nacho\Models\Request; class HomeController extends AbstractController { public function index(Request $request) { return "hello world"; } }
- Add
.htaccess
<IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^(src|.vscode|content|node_modules|CHANGELOG\.md|.secret|users.json|composer\.(json|lock|phar))(/|$) index.php # Enable URL rewriting RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .? index.php [L] </IfModule> # Prevent file browsing Options -Indexes -MultiViews
统计信息
- 总下载量: 407
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-06-13