如何向自定义块内容发送数据

问题描述 投票:0回答:1
php drupal-7 block drupal-theming
1个回答
0
投票

这在这里行不通:

$block['content'] += array(
    '#theme' => 'guestbook_last_entries',
    '#entries' => $entry,
);

如果您需要一个数组作为结果,也许您需要这个:

// note that I replaced += with a simple = and added two brackets that will create a new element in that array $block['content']
$block['content'][] = array(
    '#theme' => 'guestbook_last_entries',
    '#entries' => $entry,
);
© www.soinside.com 2019 - 2024. All rights reserved.