xiag / json-command-bundle
v1.0.1
2019-06-18 11:19 UTC
Requires
- php: >=7.3
- graviton/json-command: ~1
- jms/serializer-bundle: >=1.0
- symfony/framework-bundle: >=4.3.0
Requires (Dev)
- phpunit/phpunit: @stable
This package is auto-updated.
Last update: 2021-08-18 07:31:09 UTC
README
用于 graviton/json-command 的 Symfony 扩展包。
安装
步骤 1: 下载扩展包
运行
composer require graviton/json-command-bundle
或者在您的 composer.json
文件中添加
"graviton/json-command-bundle": "*",
步骤 2: 启用扩展包
然后,在项目的 app/AppKernel.php
文件中添加以下行以启用扩展包
<?php class AppKernel extends Kernel { public function registerBundles() { $bundles = [ // ... new \Graviton\JsonCommandBundle\JsonCommandBundle(), ]; // ... } // ... }
如何使用
注册新服务
<!-- app/config/services.xml --> <service id="my.node.executor" class="%graviton.json_command.jsonexecutor.class%"> <factory service="graviton.json_command.jsonexecutor.factory" method="createJsonExecutor"/> <argument>node</argument> <argument>array</argument> <argument type="collection"> <argument>-type=general</argument> </argument> </service>