Writing module .info files (Drupal 7.x)

Overview

概述

Drupal uses .info files to store metadata about themes and modules.

Drupal 使用 .info 文件 來存儲有關主題和模塊的信息


For modules, the .info file is used for:

對於模塊, .info 文件 用於:

rendering information on the Drupal Web GUI administration pages;

在Drupal管理員web圖形界面上呈現信息

providing criteria to control module activation and deactivation;

提供控制模塊的開啓和關閉的標準

notifying Drupal about the existence of a module;

告訴Drupal這個模塊的存在

general administrative purposes in other contexts.

在其他情況下的管理用途


This .info file is required for the system to recognize the presence of a module.    

這個 .info 文件是必需的,以便系統識別模塊的存在.


Example

例子
The following is a sample .info file:

下面是一個簡單的 .info 文件


name = Really Neat Widget
description = Provides a really neat widget for your site's sidebar.
core = 7.x
package = Views
dependencies[] = views
dependencies[] = panels
files[] = tests/example.test
configure = admin/config/content/example

The .info file should have the same name as the .module file and reside in the same directory. For example, if your module is named example.module then your .info file should be named example.info.

這個 .info 文件應該有一個相同名字的 .module 文件並且屬於同一個目錄.例如,如果你的模塊叫 example.module,那麼你的 .info 文件應該被叫做 example.info.


This file is in standard .ini file format, which defines properties in key/value pairs separated by an equals sign (key = value). You may use quotation marks to wrap the value. Quoted values may contain newlines.

這個文件是標準的 .ini文件格式,它定義了鍵/值對的屬性由一個分隔等號(鍵=值)。您可以使用引號來包裝的價值。引用的值可以包含換行符。


.info files may contain comments. A semi-colon [;] placed at the beginning of a line makes that line a comment, and that line will not be parsed.

.info 文件可以包含註釋.用分號 [;] 放置在一行的開頭,並且該行不會被解析


Note: Whenever you create or change your .info file, you will need to clear your site's cache for your changes to take effect.

注意:當你創建或更改你的 .info 文件,使更改生效,則需要清除你網站的緩存


Properties

屬性
The .info file can contain the following properties:

.info 文件 可以包含以下的屬性


Contents

內容
name (Required)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章