ellinaut/com-view-server-bundle
Composer 安装命令:
composer require ellinaut/com-view-server-bundle
包简介
Symfony integration for eos/com-view-server
README 文档
README
Symfony integration for eos/com-view-server
Replaces eos/com-view-server-bundle which isn't maintained anymore.
Installation
composer require ellinaut/com-view-server-bundle
Configuration
Create the file config/packages/eos_com_view_server.yaml with content like this:
eos_com_view_server: allow_origin: '*' # cors control; * is the default value schema: # the definition which will be available as /cv/schema.json headers: authorization: description: 'Authorization header' views: exampleView: description: 'Example view' data: success: 'exampleSchema' commands: exampleCommands: description: 'Example command' schemas: exampleSchema: description: 'Example schema' properties: example: description: 'Example property' type: 'string'
Configure your config/routes.yaml with:
eos_com_view: resource: '@EosComViewServerBundle/Resources/config/routes.xml'
Commands
Commands (classes which implement Eos\ComView\Server\Command\CommandProcessorInterface) can be registered via the
service tag com_view.command_processor in your config/services.yaml:
services: # with "command", if class name is not equal to command name YourCommand\CommandProcessor: tags: - { name: 'com_view.command_processor', command: 'executeYourCommand' } # without "command", if class name is equal to command name (in this example the command name must be "executeSecondCommand") YourCommand\ExecuteSecondCommand: tags: - { name: 'com_view.command_processor' }
Views
Views (classes which implement Eos\ComView\Server\View\ViewInterface) can be registered via the
service tag com_view.view in your config/services.yaml:
services: # with "view", if class name is not equal to view name YourView\TestView: tags: - { name: 'com_view.view', view: 'showTest' } # without "view", if class name is equal to view name (in this example the view name must be "showExample") YourView\ShowExample: tags: - { name: 'com_view.view' }
Health Providers
Health Providers (classes which implement Eos\ComView\Server\Health\ViewHealthProviderInterface or Eos\ComView\Server\Health\CommandHealthProviderInterface)
can be registered via the service tag com_view.health_provider in your config/services.yaml:
services: YourHealthProvider\TestProvider: tags: - { name: 'com_view.health_provider' }
Headers
Headers names will be lower cased by this bundle!
统计信息
- 总下载量: 576
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-12-13