HomeDocumentationContributorsArticlesChangelogSupport
DrupalConsole siteDrupalConsole site
HomeDocumentationContributorsArticlesChangelogSupport
  • Welcome
  • 什么是 Drupal Console
    为什么你应该关注?Drupal Console 是怎样提供帮助的?Drupal Console 项目相关链接
  • 安装 Drupal Console
    使用 Drupal Console 安装器使用 ComposerInstalling on Windows
  • 使用 Drupal Console
    如何拷贝配置文件如何下载,安装并运行 Drupal 8如何在多站点环境下使用 Drupal Console
  • 可用命令
  • Using site alias
    Setting up your local machineHow to use Drupal Console in a remote installationConnecting to a virtual environment
  • What is a chain command
    Registering chain commands as regular commandsListing registered commands
  • Creating custom Commands
    The Command ClassRegistering CommandsConfiguring the CommandCommand LifecycleGetting Services from the Service ContainerGenerating Code with a Command
  • 参与贡献
    最低要求获取项目如何运行保持更新创建一个 Issue 和 Pull 请求文档编写
  • 常见问题
    安装问题权限没有列出的命令交互模式
  • 参考资料
Català (ca)English (en)Español (es)فارسی (fa-ir)Français (fr)हिन्दी (hi)Magyar (hu)日本語 (ja)मराठी (mr)Português brasileiro (pt-br)Romanian (ro)pусский язык (ru)Vietnamese (vn)简体中文 (zh-hans)
  • Welcome
  • 什么是 Drupal Console
    为什么你应该关注?Drupal Console 是怎样提供帮助的?Drupal Console 项目相关链接
  • 安装 Drupal Console
    使用 Drupal Console 安装器使用 ComposerInstalling on Windows
  • 使用 Drupal Console
    如何拷贝配置文件如何下载,安装并运行 Drupal 8如何在多站点环境下使用 Drupal Console
  • 可用命令
  • Using site alias
    Setting up your local machineHow to use Drupal Console in a remote installationConnecting to a virtual environment
  • What is a chain command
    Registering chain commands as regular commandsListing registered commands
  • Creating custom Commands
    The Command ClassRegistering CommandsConfiguring the CommandCommand LifecycleGetting Services from the Service ContainerGenerating Code with a Command
  • 参与贡献
    最低要求获取项目如何运行保持更新创建一个 Issue 和 Pull 请求文档编写
  • 常见问题
    安装问题权限没有列出的命令交互模式
  • 参考资料

generate:event:subscriber

生成事件订阅者

使用方法:

drupal generate:event:subscriber  [options]
ges

可用选项

选项详细信息

--module

模块名

--name

Service name

--class

Class name

--events

从容器中加载事件

--services

从容器加载服务。

例子

Generate an event subscriber specifying the module name, its name, the class and the events to subscribe

drupal generate:event:subscriber  \
  --module="modulename"  \
  --name="modulename.default"  \
  --class="DefaultSubscriber"  \
  --events='kernel_request'
HomeDocumentationContributorsArticlesChangelogSupport
© 2020, Built using GatsbyJS