harbor/action-responder

A Responder 实现针对 ADR 模式。

dev-master 2014-05-15 19:33 UTC

This package is auto-updated.

Last update: 2024-09-17 08:31:54 UTC


README

提供 ADR 模式的 Action 和 Responder 层的实现,该模式由 ADR Pattern 定义。

这些是基础类,旨在被扩展(在大多数情况下)。

注意:ADR 模式的领域层不在此包的范围内。

动作示例

此示例使用一个 JsonAction,该动作使用一个 JsonResponder

<?php

namespace Blog\Api\Actions;

use Harbor\ActionResponder\JsonAction;

class BlogListAction extends JsonAction
{
    public function __invoke()
    {
        // Do something with your domain to get the Blog list

        $this->responder->articles = $articles;
        return $this->getResponse();
    }
}

响应者示例

即将推出...目前请查看测试。