Drupal 6的缓存可以设置为禁用,正常或激进.我找不到Drupal 7安装的这些选项.只有一个按钮可以刷新所有缓存,但是对于我对模块或模板所做的每个更改都必须单击它.通过更改,我的意思是将一些HTML标记添加到模块或模板.
感谢mirzu的回应,我已经安装了devel模块,但它也不起作用.我这样看到我的更改的唯一方法是禁用和启用模块.
hello.module看起来像:
function annotate_menu() {
$items = array();
$items['hello'] = array(
'title' => t('Hello world'),
'page callback' => 'hello_output',
'access arguments' => array('access content'),
);
return $items;
}
function hello_output() {
header('Content-type: text/plain; charset=UTF-8');
header('Content-Disposition: inline');
return 'annotate';
}
Run Code Online (Sandbox Code Playgroud)
模板page-hello.tpl.php包含print $content;
.
我通过访问该页面http://localhost/test/hello
.
涉及许多不同级别的缓存.
菜单系统实际上不是缓存.如果你在hook_menu()中更改了任何内容,则需要重建它.devel.module为开发块中的链接提供了方便的链接.
此外,Drupal还会缓存钩子实现和许多其他事情,您可以使用开发块中的另一个链接清除,或者如果您安装了drush,则使用"drush cc all".还有一种方法可以完全禁用它,但这可能会使您的网站速度变慢:http://drupal.org/node/797346