简体   繁体   English

如何从PHP的树枝翻译

[英]How to translate in twig from php

I tried to integrate an ads on my website. 我试图将广告整合到我的网站上。 So in there documentation is writing to show the ads need to do : 因此,在其中编写文档来展示广告需要做的事情:

echo captchme_generate_html($publicKey);

Now I use twig template, and I'm do in controller : 现在我使用树枝模板,并且在controller中:

$this->captch_me_template =  captchme_generate_html(self::CAPTCH_ME_PUBLIC_KEY);

And in template I do : 在模板中,我这样做:

{{ captch_me_template }}

And in template I get as result : 在模板中,我得到的结果是:

<script type="text/javascript" src="http://api.captchme.net/api/script?key=dfgfd3454.....

And I don't understand where is the problem. 而且我不明白问题出在哪里。 Can you help me please ? 你能帮我吗 ? Thx in advance and sorry for my english 提前谢谢,对不起我的英语

我找到了解决方案,有必要添加原始{{ captch_me_template|raw }}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM