0

如果 $text 和 $path 是一个变量。如何编写 l 函数。例如:$text = $term->name$path = taxonomy/term/'.$term->tid 如何编写 l 函数。我用过l($term->name,taxonomy/term/'.$term->tid)`。它不起作用。

4

1 回答 1

1

你做的一切都是对的,但我认为你错过了一个single quote. 尝试复制并粘贴以下代码

l($term->name, 'taxonomy/term/' . $term->tid);

更新:

如果l()函数没有自动显示路径别名,您可以使用drupal_get_path_alias()来获取路径别名。

l($term->name, drupal_get_path_alias('taxonomy/term/' . $term->tid));
于 2012-12-12T09:17:59.730 回答