dq8081 2013-04-22 16:43
浏览 57

如何将自己的HTML标记添加到此PHP代码(数组)

Can you please advise how do I add my own HTML tag to the part of PHP code? I am talking about part "This part need HTML tag".

<div id="downbarek2">
    <?php
        $vid = 59;
        function termSort($a, $b) {return strcmp($a->name, $b->name);}

        $terms = taxonomy_get_tree($vid);   usort ($terms,'termSort');

        foreach ($terms as $term) {
            if ($term->depth == 1) {  
                print  "" .l( "This part need HTML tag " .$term->name,'taxonomy/term/'.$term->tid, array('title' => $term->name)). "";
            } 
        }  
    ?>
</div>

So, my question is: how can I extend this part of HTML tag, such as...

print  "" .l( "<b>This text need HTML tag</b> " .$term->name,'taxonomy/term/'.$term->tid, array('title' => $term->name)). "";
  • 写回答

1条回答 默认 最新

  • dougan7523 2013-04-22 17:10
    关注

    In drupal, to achieve this by seting array('html' => TRUE)

    print  l( t("<b>This text need HTML tag</b> " .$term->name,'taxonomy/term/'.$term->tid), array('attributes' => array('title' => $term->name, ), 'html' => TRUE) );
    

    Reference: http://api.drupal.org/api/drupal/includes%21common.inc/function/l/7

    评论

报告相同问题?

悬赏问题

  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端
  • ¥15 基于PLC的三轴机械手程序
  • ¥15 多址通信方式的抗噪声性能和系统容量对比
  • ¥15 winform的chart曲线生成时有凸起
  • ¥15 msix packaging tool打包问题
  • ¥15 finalshell节点的搭建代码和那个端口代码教程
  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作