2011-12-12 125 views
0

我想修改注册模块gallery3。我在窗体中添加了一个新元素(它由Forge生成),但想要将超链接添加到相关标签。不幸的是它被脚本转义了,即使是一个html :: mark_clean()也没有帮助。gallery3,在表格标签中使用html

这里是我的代码:

$form = new Forge("register/handler", "", "post", array("id" => "g-register-form")); 
$group = $form->group("register_user")->label(t("Register user")); 

$group->checkbox("accept_terms")->label(html::mark_clean(t(html::mark_clean('I confirm to have read the <a href="%url">terms of usage</a>.'), 
      array("url" => html::mark_clean("http://www.google.de"))))) 
      ->id("g-accept-terms") 
    ->rules("required") 
    ->error_messages("accept", t("You have to accept the terms of usage before you may register.")); 

正如你可能会看到我已经添加了mark_clean在测试用的不同的位置。

结果如下:

<label> 
    <input type="checkbox" class="checkbox" value="1" name="accept_terms" id="g-accept-terms"> 
    I confirm to have read the &lt;a href="http://www.google.de"&gt;terms of usage&lt;/a&gt;. 
</label> 

我想,以避免改变任何现有的核心文件。 感谢您的帮助!

回答

0
$group->checkbox("accept_terms")->label(t('I confirm to have read the <a href="http://yourURL.com/" target="_blank">terms of usage</a>. more text')) 
    ->rules("required") 
    ->error_messages("accept", t("You have to accept the terms of usage before you may register.")); 
+0

对不起,但这是肯定不是我的问题的答案。正如我在第一篇文章中写的,所有的html都被系统转义。 – LordOfBerlin