angel-project / framework
实际的angel框架。
v0.0.5
2018-06-15 18:25 UTC
Requires
- angel-project/core: v0.0.*
- filp/whoops: v2.1.*
This package is not auto-updated.
Last update: 2024-09-25 10:38:02 UTC
README
Angel是一个专注于Web应用程序快速原型设计的轻量级PHP框架。
安装
使用以下命令通过Composer进行安装
composer create-project angel-project/framework .
服务器设置
如果您正在运行一个Nginx服务器,请在nginx.conf中添加以下行以启用URI重定向并重新启动服务器。
location / { index index.php index.html; try_files $uri/ $uri /index.php?$query_string; }
对于Apache服务器,首先在httpd.conf中取消注释以下行。
LoadModule rewrite_module lib/httpd/modules/mod_rewrite.so
然后,添加以下行并重新启动服务器。
<Directory "/your/web/site/dir"> RewriteEngine on RewriteRule "(.*)" "index.php?$1" [PT,QSA] </Directory>
入门
使用build::get()
模块创建您的第一个页面。在文件夹/build下创建一个名为hello_world.php的PHP文件。
build::get("angel/[input]", function($input){ echo "angel".$input."!"; });
如上所示,build::get()方法包含两个参数
- 一个路由:yoursite.com/hello/[变量名],URL中的变量由方括号定义。
- 一个函数:当用户使用GET请求访问路由的路径时将执行的代码块。
所以现在,如果您访问yoursite.com/angel/fly
angel fly!
文档
在GitHub上阅读我们的wiki!
路线图
支持Apache URI配置添加欢迎页面- 文档
- 提高图像处理能力:(调整大小、裁剪、模糊和水印)
- math::模块
- ...