我想在views-view-fields--field-name.tpl.php模板文件中使用自定义函数。我要把它放哪儿?在一些预处理函数中可以在template.php中使用它吗?
发布于 2013-08-03 11:24:43
您可以在template.php文件中使用预处理函数。例如:
function YOURTHEME_preprocess_views_view_fields__field_name(&$vars) {
// Do your changes for the field here
}发布于 2013-08-03 23:01:51
在Drupal 7中,可以使用模块_加载_包括或包括_一次实现这一点。
module_load_include()或include_once() 包含该文件。module_load_include('file_type', 'module_name', 'base_file_name');include_once 'FILE_PATH';https://drupal.stackexchange.com/questions/81382
复制相似问题