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小节:

评论 (写第一个评论)