echo "<td><a href='{{ URL::to('index/watch/' . $tmpd) }}''>$tmpd </a></td>";
输出必须为http://localhost:8000/index/watch/myvar
但它也是http://localhost:8000/%7B%7B%20URL::to(
我的回音错误是什么
答案 0 :(得分:2)
正如马克·贝克所说,不要在echo
中包含整个陈述,而且对于网址,您需要使用非转义标记{!! !!}
:
<td><a href='{!! URL::to('index/watch/' . $tmpd) !!}'>{{ $tmpd }}</a></td>
答案 1 :(得分:2)
使用laravel助手总是很好的做法。以下代码生成您要查找的html链接。
echo '<td>'.link_to('index/watch/'.$tmpd.'', $tmpd).'</td>';