2014-02-25 41 views
1

links__system_main_menu在drupal中有什麼用?links__system_main_menu in drupal

<?php if ($main_menu): ?> 
     <div id="main-menu" class="navigation"> 
     <?php print theme('links__system_main_menu', array(
      'links' => $main_menu, 
      'attributes' => array(
      'id' => 'main-menu-links', 
      'class' => array('links', 'clearfix'), 
     ), 
      'heading' => array(
      'text' => t('Main menu'), 
      'level' => 'h2', 
      'class' => array('element-invisible'), 
     ), 
     )); ?> 
     </div> <!-- /#main-menu --> 

回答

1

這是主題鉤子的模式,形式爲[base hook] __ [context]。當鏈接主題與theme('links__system_main_menu', $variables)theme()功能搜索* theme_links__system_main_menu()*並使用它。否則,如果找不到,它將使用* theme_links()*。欲瞭解更多信息,請查看theme Doc