PHP 小型分发库 PHP ATC

码农软件 · 软件分类 · REST/RESTful项目 · 2019-03-10 23:12:47

软件介绍

ATC 是一个 PHP 的小型分发库,基于 Aura.Router 包和 Symfony 的 HttpFoundationEventDispatcher 构建。

关于该库需要知道的两项内容:

  1. 每个单一路由匹配到一个单一的 Action 类

  2. Action 的异常处理可通过实现 ActionInterface 变成一个新的 Action

Action 是什么?Action 就是只提供一个方法的 Controller。

示例代码:

$router->addGet('Index', '/');

namespace Your\Namespace\Prefix;

class Index extends \Aol\Atc\Action
{
    public function __invoke(Request $request)
    {
        return new Response::create('Hello world');
    }
}

本文地址:https://codercto.com/soft/d/1078.html

Structure and Interpretation of Computer Programs - 2nd Edition

Structure and Interpretation of Computer Programs - 2nd Edition

Harold Abelson、Gerald Jay Sussman / The MIT Press / 1996-7-25 / USD 145.56

Structure and Interpretation of Computer Programs has had a dramatic impact on computer science curricula over the past decade. This long-awaited revision contains changes throughout the text. Ther......一起来看看 《Structure and Interpretation of Computer Programs - 2nd Edition 》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具