我可以像这样生成一个基本链接:
This is an [example link](http://example.com/).
我可以生成带有动态链接的按钮,如下所示:
@component('mail::button', ['url' => \URL::to('/subscriptions/'.$recipient->id.'/'.$recipient->email.'?action=subscribe')])
Sign Me Up
@endcomponent
但是如何生成动态链接而不是按钮?
我尝试过:
[Safe Unsubscribe]( url('/subscriptions/'.$recipient->id.'/'.$recipient->email.'?action=unsubscribe') )
和
[Safe Unsubscribe]( \URL::to('/subscriptions/'.$recipient->id.'/'.$recipient->email.'?action=unsubscribe') )
但这些输出以字面方式显示:
url('/subscriptions/'.%24recipient-%3Eid.'/'.%24recipient-%3Eemail.'?action=subscribe%27)
答案 0 :(得分:2)
您仍在刀片服务器模板中。因此,如果您不在Blade指令中,并且想要回显内容,则必须使用大括号。
[Safe Unsubscribe]({{ url('/subscriptions/'.$recipient->id.'/'.$recipient->email.'?action=unsubscribe') }})