towersystems/resource-bundle

该包的最新版本(1.1.4)没有可用的许可证信息。

Zend Expressive ; 应用程序中的资源

1.1.4 2019-12-10 22:32 UTC

This package is auto-updated.

Last update: 2024-09-23 11:04:11 UTC


README

注册一个可在您的应用程序中使用的资源。

将为您的资源生成资源控制器、工厂、仓库和 CRUD API。

例如

注册一个新的资源

[
    'towersystems_resource' => [
        "resources" => [
            'tower.category' => [
                'classes' => [
                    'model' => Category::class,
                    'interface' => CategoryInterface::class,
                ],
            ],
        ],
    ],
];

创建 API 路由

[
    'towersystems_resource' => [
        'routes' => [
            'category' => [
                'alias' => 'tower.category',
                'only' => ['show', 'index', 'create', 'update', 'delete'],
            ],
        ],
    ],
];

服务管理器

    $container->get("tower.repository.category");
    $container->get("tower.factory.category");
    $container->get("tower.handler.category");