0

在 Drupal7 主题 Getting Parse error: syntax error, unexpected T_DOUBLE_ARROW in /sites/all/themes/arizona_horizo​​ntal/template.php 在第 254 行

    function template_node_submitted(&$variables){
return t('By !username on @datetime',
array('!username' => theme('username', $variables['node'], '@datetime' => format_date($variable['node']->created),));

}

你能告诉我我到底哪里出错了。

4

1 回答 1

0

第二个双箭头 ( '@datetime' =>) 必须在array(). 我不知道您要做什么,但我想您想写:

function template_node_submitted(&$variables){
  return t('By !username on @datetime', array(
      '!username' => theme('username', $variables['node']),
      '@datetime' => format_date($variable['node']->created),
  ));
}

您可能应该考虑使用更好的缩进来格式化您的代码,这样您就可以快速看到这种语法错误。

于 2013-09-12T21:45:53.083 回答