i3elj/agmen
最新稳定版本:1.0.3
Composer 安装命令:
composer require i3elj/agmen
包简介
A simple web library
README 文档
README
A simple opinionated web library to be used alongside nginx or apache.
Installation
composer require i3elj/agmen
How to use it
Look into the examples folder, is not hard to understand the code. Basically you configure the default folders for views, globals, partials, etc... using define(), require the autoload and use the Router class to add endpoints. Routes can have names, it uses classes and you can define the name of the method to be used for the endpoint, otherwise the Router will look into methods named after request methods (e.g. static::get, or static::post...). Use snip() for partials and globals() for... well, globals. There are some helper functions (just a few, look into the code).
The Database class needs a .env file with the following:
# host name for PDO interface: sqlite, pgsql, mysql... DB=sqlite # used only for sqlite host name DB_URL=db.sqlite # common variables used with server based databases: postgresql, mysql, mariadb etc... DB_HOST=localhost DB_PORT=8080 DB_USER=admin DB_PASSWORD=admin DB_NAME=dbname
Contributing
I don't plan on supporting this more than I need. If you have something to add up, and it makes sense, I'll be glad to add your contribution.
统计信息
- 总下载量: 11
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-09-30
