- EBT Blocks 🧱
- EPT Paragraphs 🆕
-
Resources & Support
- What's New
- 事件
- 联络表
额外区块类型 (EBT) - 全新的布局构建器体验❗
滚动
通过命令行安装模块
06/10/2025, by Ivan
Menu
除了通过用户界面安装模块外,你还可以通过命令行下载并安装模块:
- 推荐的模块(和主题)下载方式是使用 Composer。不过,你仍然可以使用 Drush 8 或 Drupal Console 下载模块,但这种方式不会更新你的 composer.json 文件。
- Drush 和 Drupal Console 都可以为你安装模块和主题。(在 Drupal 8 中,安装和启用模块是同一个操作。)
从命令行下载和安装模块是扩展你网站的最快方法。
Drush
在 Drush 8 中,你可以使用以下命令下载模块:
drush dl module_name
要使用 Drush 安装模块,请运行以下命令:
drush en module_name
然后清除缓存:
drush cr
打开浏览器并刷新页面,你将看到模块的功能已添加到网站中。
Drupal Console
要使用 Drupal Console 安装模块,请运行以下命令:
drupal moi module_name
使用 Drupal Console 下载模块,请执行:
drupal mod module_name