码迷,mamicode.com
首页 > 其他好文 > 详细

drupal7 如何自定义内容部链接,并预留hook接口(自定义视图字段比较有用)

时间:2014-07-12 21:02:44      阅读:236      评论:0      收藏:0      [点我收藏+]

标签:io   line   re   ar   c   php   

    $links = array();

    //获取系统菜单,所有权限都默认进行了验证
    $links['case-edit']=menu_get_item('node/'.$row->nid.'/edit');

    //自定义链接地址
    $links['custom_url']=array(
         'title' => t('custom_url'),
         'href' => 'custom/url',
         'attributes' => array('class' => array_merge(cdialog_link_class(), array('custom_class')))
     );

    //抛出hook钩子
    drupal_alter('custom_operatioin_links',$links);

    //输出链接地址
    if (!empty($links)) {
      echo theme('links', array('links' => $links, 'attributes' => array('class' => array('links', 'inline', 'custom_operations'))));
    }


drupal7 如何自定义内容部链接,并预留hook接口(自定义视图字段比较有用),布布扣,bubuko.com

drupal7 如何自定义内容部链接,并预留hook接口(自定义视图字段比较有用)

标签:io   line   re   ar   c   php   

原文地址:http://blog.csdn.net/wjc19911118/article/details/37696063

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!