crowdreactive/lob-bundle

Lob.com PHP SDK 的 Symfony 扩展包

2.0.0 2016-02-11 12:49 UTC

This package is not auto-updated.

Last update: 2024-09-14 18:58:36 UTC


README

封装了 Lob.comPHP SDK,以配置 Symfony 扩展包。

由 CrowdReactive 提供,CrowdReactive 是 EventsTag 的制作者。

Build Status Scrutinizer Code Quality Code Coverage Latest Stable Version SensioLabsInsight

使用方法

  1. 安装扩展包

    composer require crowdreactive/lob-bundle
    
  2. 将其添加到 AppKernel

    class AppKernel {
        public function registerBundles() {
            $bundles = [
                new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
                // ...
                new CrowdReactive\LobBundle\CrowdReactiveLobBundle(),
            ];
        }
    }
  3. 配置

    crowd_reactive_lob:
        # Required
        api_key: abc123
    
        # Optional
        version: 1.5.0      # A specific version of the API
  4. 访问 Lob 服务

    Lob\Lob 实例在依赖容器中名为 crowd_reactive_lob.lob。使用以下方式访问它:

    $this->container->get('crowd_reactive_lob.lob');
    my_postal_service:
        class: My\PostalService
        arguments:
            -   "@crowd_reactive_lob.lob"

贡献

欢迎 PR!确保使用 composer run tests 运行测试。

许可证

此扩展包受 MIT 许可证保护。 查看完整的许可证