首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >按模式自动加载文件,而不是列出每个文件

按模式自动加载文件,而不是列出每个文件
EN

Drupal用户
提问于 2012-09-13 12:17:30
回答 1查看 125关注 0票数 1

Drupal的“自动加载”要求将文件包含在files[]声明在.info中文件中。

当有很多文件时,这会变成:

  • 一张巨大的清单。
  • 很难维持。

是否有一种方法可以用模式来包含。说lib/*.php

EN

回答 1

Drupal用户

发布于 2013-05-02 16:25:33

索洛阿德已经做了很长时间了:)

Doc页面:http://drupal.org/node/1976198

对你的情况来说,这应该足够了:

代码语言:javascript
复制
dependencies[] = xautoload

; Only look at the top level directory
files[] = lib/*.php

代码语言:javascript
复制
dependencies[] = xautoload

; Scan the top level and deeper.
files[] = lib/**/*.php

如果你需要更多的东西:

代码语言:javascript
复制
; Ignore the top level, only scan deeper directories.
files[] = lib/*/**/*.php

; Ignore the top level, scan second level, ignore deeper levels.
files[] = lib/*/*.php

那就祝你好运!

票数 1
EN
页面原文内容由Drupal提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://drupal.stackexchange.com/questions/42578

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档