PHP新手。出现"分析错误:语法错误,意外的T_CONSTANT_ENCAPSED_STRING"问题
这是代码:
<?php
$moreLink = '';
if ($data->node_type == "product_book") :
$path = str_replace(' ', '-', strtolower($data->node_title));
$moreLink = '<a href="/books/'.$path'">Read more > </a>';
else :
$path = drupal_get_path_alias( 'node/' . $data->nid);
$moreLink = '<a href="/'.$path.'">Read more > </a>';
endif;
return $moreLink;
?>
如有任何帮助,我们将不胜感激。谢谢-Matt
您忘记了这一行的.
:
$moreLink = '<a href="/books/'.$path'">Read more > </a>';
应该是
$moreLink = '<a href="/books/'.$path.'">Read more > </a>';
^ here