Drupal 7 - How to load a template file from a module?

前端 未结 5 569
时光说笑
时光说笑 2021-02-08 04:06

I am trying to build my own module in Drupal 7.

So I have created a simple module called \'moon\'

function moon_menu() {
  $items = array();
      $items         


        
5条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-08 04:46

    In drupal 7 I was getting the following error when using :

    return theme('moon', $content);

    Was resulting in "Fatal error: Unsupported operand types in drupal_install\includes\theme.inc on line 1071"

    This was fixed using :

    theme('moon', array('content' => $content));

提交回复
热议问题