1 回答

TA貢獻1864條經驗 獲得超2個贊
不知道如何以及為什么,但在我的樹枝文件中呈現了該功能:
<p class="media-body pb-3 mb-0 small lh-125 border-bottom border-gray">
<strong class="text-gray-dark">Autheur : </strong>
<a href="{{ path('theme_created_by', {'lastname': theme.user.lastname}) }}">
{{ theme.user.lastname }}
</a>
<br/>
<a href="{{ path( 'theme_show', {'id' : theme.id} ) }}">
<strong>{{ theme.name }}</strong><br/>
</a>
我將該路徑行替換為:
<a href="{{ path('theme_created_by', {'username': theme.user.username}) }}">
{{ theme.user.lastname }}
</a>
也更改了我的路線中傳遞的參數:username @Route("/themes/by/{username}", name="theme_created_by") 現在它可以工作了..
- 1 回答
- 0 關注
- 383 瀏覽
添加回答
舉報