dshtze500055 2018-09-11 06:27
浏览 52
已采纳

Drupal 7主题Template.php意外的T_OBJECT_OPERATOR错误

I'm new to Drupal development and trying to run a preprocess function for a content type inside my custom theme's template.php.

Here's my code:

function MYTHEME_preprocess_article(&$variables) {
  if (!field_image_alt_text->getValue().strlen() = 0 || null ) { set value to something }else {return;}
};

but it returns a syntax error as:

Syntax Error: Unexpected T_OBJECT_OPERATOR

How can I . resolve this error?

Thanks in advance!

  • 写回答

1条回答 默认 最新

  • dongshi1424 2018-09-11 08:19
    关注

    u dont resolve this, code not php language

    function MYTHEME_preprocess_article(&$variables) {
      if (strlen(field_image_alt_text->getValue()) = 0 || null ) { set value to something }else {return;}
    };
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?