【问题标题】:Drupal 7 - fatal error with devel themer plugin with custom moduleDrupal 7 - 带有自定义模块的开发主题插件的致命错误
【发布时间】:2011-07-15 10:45:52
【问题描述】:

我刚刚安装了一个名为 devel themer 的著名 Drupal 模块。它适用于管理和其他核心页面,如 node.js。问题是我的模块出现致命错误。

错误信息: 致命错误:无法在第 293 行的 /home/dev-bioshock/public_html/sites/all/modules/devel_themer/devel_themer.module 中取消设置字符串偏移

我的模板.php

function bioshock_theme($existing, $type, $theme, $path) {

    return array(
        'moon_display'=>array(
            'template'=>'moon'

        ),

    );

}

我的模块.module

function moon_perm() {
  return array('access apps content');
}

function moon_menu() {

      $items['moon'] = array(
      'title' => 'this is a test',
      'description' => t('Detalle de un Programa'),
      'page callback' => 'moon_page',
      'access arguments' => array('access content'),
      'type' => MENU_CALLBACK
  );

  return $items;
}

function moon_page(){

    $moonsvariable = 'hi this is a function';
    return theme('moon_display',$moonsvariable);

}

我的代码中有错误吗?

【问题讨论】:

    标签: drupal module php


    【解决方案1】:

    theme() 的第二个参数必须是一个数组。参见例如http://drupal.org/node/933976。另见Drupal 7 - How to assign a variable to a template?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多