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)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值