Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可以修改此代码片段以显示 html 编码吗?
<?php $_option = $this->getOption() ?> <?php echo $this->htmlEscape($_option->getTitle()) ?>
它显示了一个标题,但在那个标题中我有一个href:
<a href="http://link" target="otherwindow">link</a>
而不是显示为链接,它只是向我显示代码。我希望它是一个可点击的链接。
可能的?
是的,只需删除 $this->htmlEscape() 并保留 $_option->getTitle()
转义功能只是提供无法使用(或注入)html命令或javascript的功能。