使用 Html 助手在 cake php 中结束 span 标签
如何在 cake php 中结束标签
它在 cake 教程中给出,当文本给定 null 时,下面的 span 标签将由 html 帮助器形成。
<?php echo $this->Html->tag('span', null, array('class' => 'welcome'));?>
//Output
<span class="welcome">
但是,这里不知道如何结束 span 标签。如何给它 html 帮助器
<span class="welcome">
//inner elements
</span>
cake php html 帮助器中是否有任何东西可以关闭任何元素标签,例如
<?php echo $this->Html->tag('span', 'close') ?>
将输出为
</span> .
How to end the tag in cake php
It is given in cake tutorial the below span tag will be formed by html helper, when text is given null.
<?php echo $this->Html->tag('span', null, array('class' => 'welcome'));?>
//Output
<span class="welcome">
But, here no idea about ending span tag.How can it be given html helper
<span class="welcome">
//inner elements
</span>
Is there anything in cake php html helper to close any element tags like
<?php echo $this->Html->tag('span', 'close') ?>
will output as
</span> .
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您还可以这样做:
You can also do this:
调用
tag
方法时,您必须为第二个参数提供空字符串""
,而不是null
。否则,它只是根据 打印开始标记API 文档。You have to provide an empty string
""
, instead ofnull
, for the second parameter when calling thetag
method. Otherwise, it just prints the start tag according to the API docs.