6.5 创建info.yml文件

  • 1龺龶龵hello_world.info.yml龔龐
  • 2龺龈龅龃龂齾齻
    name: 'hello_world'
    package: 'Custom'
    description: 'An example module showing how to define a page to be displayed at a given URL.'
    type: module
    core: 8.x
    齇齆齄齁鼽鼺鼶鼳鼰鼭龺鼳鼰鼺鼶龺鼬鼪鼦(鼣)鼜鼚鼙鼗鼓鼐鼏鼋Drupal 8鼅鼳鼰鼁黽黹黵黴name黱黰鼐鼏鼋鼳鼰鼁黽黹黵鼅鼭黭鼜description黱黰鼐鼏鼋鼳鼰鼁黽黹黵鼅鼺鼶鼜package黩黨黥鼳鼰黢齄黠鼣黴黝黜Core鼦黚黗Drupal 8黖黓黑黍鼅鼳鼰黴黊鼙黇黄黂齁package:Custom黀麼麹鼳鼰鼪鼽麵黰麴鼳鼰鼦黴type麰齁黚黱黰麮麪鼅麦麥鼜麣麠麟麛module龺theme麙profile黴

info.yml黄麖麔麒麏鼅麋麈鼪麇麅

name: hello_world
description: Creates a page showing "Hello World"
package: Custom
type: module
core: 8.x
dependencies:
- datetime: datetime
- link: link
- drupal: views
test_dependencies:
  - drupal: image

configure: hello_world.settings
hidden: true

# Note: do not add the ‘version’ property yourself!
# It will be added automatically by the packager on drupal.org

version:1.0
  • dependencies: 鹢鹞鹛鼅鼳鼰鹗鹕鼅鼳鼰黴麒鹓鹒麛{project}:{module}鼜{project}黚鹞鹊鼋Drupal.org鹇鹅url鹄鼅鹇鹅鼭黭鼜黝黜drupal.org/project/views鼜{module}黚鼳鼰鼅鸿鸽鼭黴

  • test_dependencies: 鸻鸷鼅鹗鹕鼳鼰黴testbot鼓黥鸴鸱鼳鼰鼅鹗鹕鸮鸪黢齄鸻鸷黴黜鸩鸧鸦鸻鸷鹗鹕鸮鸪黚鸤鸡鼅龺鸠鸴鼅鼜鸜鸘鼗麒鸕鸒dependencies鹄黴鼋鸏黵鼅黝鸍鹄鼜鼋鸻鸷鸌鸉testbot鼓鼦鸅image鼳鼰黴鸄鸀鷿鷼鷻鷹Hello World Module鷹鼳鼰鷵鷲鼓鷮鷭鷼鷻image鼳鼰黴鸻鸷鹗鹕鼅鷪鼭鷦鷢鷠鹗鹕鼅鷪鼭鷦鷢鷝鷙黴 testbot鸻鸷鷖 https://www.drupal.org/docs/8/phpunit/running-phpunit-tests黴

  • configure: 黜鸩鹛鼅鼳鼰黑黍鷔麋鸱鷒鷑黀鷍鼜鼋黇黄麣龃黱黰鷒鷑鼅鷌黗黴鷉齁鷅麪鷂鼳鼰鷁鶽鷵鼜鼚鼗鼓鼋Extend黹(/admin/modules)鼐鼏麋鸱鶹鶶黴

  • hidden:true 鼋鸀鷿Extend黹黵(/admin/modules)鼅鼳鼰鹢黀鹄鶴鶱鹛鼅鼳鼰黴黜鸩鼳鼰鶰鶰鼦鸅麋鸱鸻鸷麙麰麛麋鸱鷂鶬黝鸍鼜鹛鶬鹊黂齁黇鸱鶫黚鶩鶨麔齁鼅黴

鶥麣龃鼋settings.php龔龐鹄鶡龅

$settings['extension_discovery_scan_tests'] = TRUE

龃鼐鼏鼳鼰黴

本书共79小节:

评论 (写第一个评论)