Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/277.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 7中将数据打印到面板窗格?_Php_Drupal_Drupal 7 - Fatal编程技术网

Php 如何在Drupal 7中将数据打印到面板窗格?

Php 如何在Drupal 7中将数据打印到面板窗格?,php,drupal,drupal-7,Php,Drupal,Drupal 7,我正在尝试向面板发送数据 我有一个简单的.tpl文件,目前只打印一条消息: <?php print $message; ?> 在panel.inc文件中,我有: /** * Implements hook_ctools_plugin_directory(). */ function message_ctools_plugin_directory($owner, $plugin_type) { if (($owner === 'ctools' && !empt

我正在尝试向面板发送数据

我有一个简单的.tpl文件,目前只打印一条消息:

<?php print $message; ?>
在panel.inc文件中,我有:

/**
 * Implements hook_ctools_plugin_directory().
 */
function message_ctools_plugin_directory($owner, $plugin_type) {
  if (($owner === 'ctools' && !empty($plugin_type)) || ($owner === 'panels' && $plugin_type === 'styles')) {
    return "plugins/$plugin_type";
  }
}

/**
 * Implements hook_theme().
 */
function message_theme() {
  return [
    'message_base' => [
      'template' => 'theme/message',
      'variables' => [
        'message' => '',
      ],
    ],
  ];
}
function message_panel_render($subtype, $conf, $args, $contexts) {
  $block = new stdClass();

  $config = default_settings();

  $block->content = [
    '#theme' => 'message_base',
    'message' => filter_xss($config['message']),
  ];

  return $block;
}
当I
dpm($block)时在上述函数中,我看到所有内容都是正确的。只是什么都没有到达.tpl文件


有人知道我做错了什么吗?

发现它在
'.\message'=>过滤器xss($config['message']),