2017-06-02 26 views
0

我有这样的一行代码CakePHP的:添加链接到回波

<?php echo __('This is text and the word TEXT has to be a link'); ?> 

有什么好的技巧单词“TEXT”链接到另一个HREF地址?也许没有改变整个结构?当我使用i18n翻译作为网站使用3种语言时,我想尽可能保持最小的变化。

在此先感谢!

回答

3

你可以尝试通过您的链接作为参数传递给__()函数:

<?= __('This is text and the word {0} has to be a link', $this->Html->link(...)) ?> 

更多信息可以在这里找到: