定制 crell/transformer-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

crell/transformer-bundle

Composer 安装命令:

composer require crell/transformer-bundle

包简介

Symfony Bridge for the Crell Transformer library.

README 文档

README

This is a Symfony integration package for the Crell/Transformer library.

Usage

See the Transformer library README file for full usage information. This bundle adds the ability to register Symfony services and string-class-method names, ie, from a service container, as transformers.

class TransformerService 
{
    public function transform(HtmlPage $h)
    {
        // .. Do stuff.
        return new Response();
    }
}

// Register TransformerService in the Container as "page_transformer".

$bus = new ContainerAwareTransformerBus(Response::class);
$bus->setContainer($container);
$bus->setTransformer(HtmlPage::class, 'page_transformer:transform');

$bus->transform(new HtmlPage());

In practice of course you would want to call setTransformer from your container configuration, not inline.

This bundle does not automatically register a transformer with the container. You will have to do that yourself, along with whatever configuration is appropriate for your application. (You can also, of course, register several different transformation pipelines for different use cases if appropriate.)

A suggested usage is to register a single transformation bus as a kernel::VIEW listener. That way, Controllers may return any number of different objects and they can all get folded down to a Response object with less overhead than registering a whole bunch of manually-ordered view listeners.

Installation

The preferred method of installation is via Composer with the following command:

composer require crell/transformer-bundle

See the [Composer documentation][2] for more details.

Alternatively, clone the project and install into your project manually.

License

This library is released under the MIT license. In short, "leave the copyright statement intact, otherwise have fun." See LICENSE for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-01-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固