You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

PrestaShop 1.6转1.7:如何用{url}助手替换后台控制器链接?

Hey there! I’ve handled plenty of PrestaShop 1.6 to 1.7 module migrations, so let’s get this sorted for you.

First, the context you noted is spot-on: the $link object is deprecated in 1.7 (it’s still available for backward compatibility but will be removed eventually), so switching to the {url} Smarty helper is the right move.

Here’s how to replace that old line properly:

This aligns with PrestaShop 1.7’s routing system:

{url entity='admin' controller='Modules'}

PrestaShop 1.7 uses camelCase for controller names in the {url} helper, so AdminModules from the old getAdminLink call becomes just Modules here.

Option 2: Using the direct path

If you prefer a more straightforward approach, you can use the clean URL path directly:

{url path='/admin/modules'}

Just make sure your PrestaShop instance has friendly URLs enabled (standard in 1.7) for this to work correctly.

Quick Validation Tip

After updating your TPL file, load the page and click the link to confirm it takes you to the Admin Modules page. You’ll notice the URL uses 1.7’s modern routing structure instead of the query-string-based format from 1.6.

内容的提问来源于stack exchange,提问作者Deepak Vaishnav

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.29 07:34:42