mathsgod/puxt 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mathsgod/puxt

最新稳定版本:3.2.0

Composer 安装命令:

composer require mathsgod/puxt

包简介

PHP framework

README 文档

README

Setup

Create pages folder and add index.php file

use Laminas\Diactoros\Response\HtmlResponse;
return new class{
    public function get(){
        return new HtmlResponse("Hello world");
    }
}

It will output Hello world in the browser when reqeust to / path.

Debug

Set the DEBUG environment variable to true to enable debug mode.

DEBUG=true

Exception format

Set the DEBUG_EXCEPTION_FORMAT environment variable to json to enable exception format.

DEBUG_EXCEPTION_FORMAT=json

Base path of uri

Set the BASE_PATH environment variable to change the base path. For example, set BASE_PATH to api will change the base path to /api.

BASE_PATH=api

Route strategy

Set the ROUTE_STRATEGY environment variable to change the route strategy.

ROUTE_STRATEGY=json

HTML header

It will change the html title to Custom title.

use function PUXT\useHead;

//call this function in the get method of the page
useHead([
    "title" => "Custom title",
]);

.htaccess

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php [L]

统计信息

  • 总下载量: 510
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-04-23