Skip to content

Instantly share code, notes, and snippets.

@EclipseGc
Created September 28, 2012 20:41
Show Gist options
  • Save EclipseGc/3801984 to your computer and use it in GitHub Desktop.
Save EclipseGc/3801984 to your computer and use it in GitHub Desktop.
<?php
namespace Drupal\bartik\blocks;
use Drupal\layout\Plugin\block\block\PagePrimaryLinks;
class PrimaryLinks extends PagePrimaryLinks {
/**
* Implements BlockInterface::build().
*/
public function build() {
return array(
'#prefix' => '<div id="main-menu" class="navigation">',
'#suffix' => '</div>',
'#children' => theme('links__system_main_menu', array(
'links' => menu_main_menu(),
'attributes' => array(
'id' => 'main-menu-links',
'class' => array('links', 'clearfix'),
),
'heading' => array(
'text' => t('Main menu'),
'level' => 'h2',
'class' => array('element-invisible'),
),
)),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment