Php 未显示Drupal部分

Php 未显示Drupal部分,php,drupal,drupal-7,Php,Drupal,Drupal 7,我有一只脚 模板/partials/footer.tpl.php 页脚 我已经将它添加到template.php文件中的theme()钩子中 template.php function scratch_theme($existing, $type, $theme, $path){ return array( 'footer' => array('template' => 'templates/partials/footer'), ); } 但是,当我调

我有一只脚

模板/partials/footer.tpl.php 页脚

我已经将它添加到template.php文件中的theme()钩子中

template.php

function scratch_theme($existing, $type, $theme, $path){
    return array(
       'footer' => array('template' => 'templates/partials/footer'),
    );
}
但是,当我调用它时,它不会显示

page.tpl.php

<?php $mainMenu = scratch_get_main_menu(); ?>

<div class="menu">
<ul>
    <?php foreach($mainMenu as $item){
    echo "<li>" . $item['link']['link_title'] . "</li>";
    }?>
</ul>
</div>

我已经转储了var,但是没有,我只得到一个空字符串


非常感谢您的帮助

您错过了以下几点:

每个信息数组必须包含“variables”元素或“render元素”,但不能同时包含这两个元素

因此:

而缓存清除应该可以修复它

function scratch_theme($existing, $type, $theme, $path){
    return array(
       'footer' => array(
         'template' => 'templates/partials/footer',
         'variables' => array(),
       ),
    );
}