Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/drupal/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 为什么drupal将?1附加到我的css文件链接中_Php_Drupal - Fatal编程技术网

Php 为什么drupal将?1附加到我的css文件链接中

Php 为什么drupal将?1附加到我的css文件链接中,php,drupal,Php,Drupal,我的设计师注意到,在drupal站点的源代码中,所有的.css文件都添加了一个?1,他担心这会破坏东西。为什么要这样做 <link type="text/css" rel="stylesheet" media="all" href="/modules/modules/node/node.css?l" /> <link type="text/css" rel="stylesheet" media="all" href="/modules/modules/system/defaul

我的设计师注意到,在drupal站点的源代码中,所有的.css文件都添加了一个?1,他担心这会破坏东西。为什么要这样做

<link type="text/css" rel="stylesheet" media="all" href="/modules/modules/node/node.css?l" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/modules/system/defaults.css?l" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/modules/system/system.css?l" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/modules/system/system-menus.css?l" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/modules/user/user.css?l" />

我翻遍了drupal的源代码,发现如下:

// A dummy query-string is added to filenames, to gain control over
// browser-caching. The string changes on every update or full cache
// flush, forcing browsers to load a new copy of the files, as the
// URL changed.
$query_string = '?'. substr(variable_get('css_js_query_string', '0'), 0, 1);
我想这就是答案。我将假设,由于drupal的人正在这样做,浏览器在css链接标记中使用查询字符串是很酷的,尽管我的设计师对此有点偏执


希望这有助于某人在Google的day=p

下面的博客文章也解释了这种做法: