Builds and returns the renderable array for this block plugin.
array A renderable array representing the content of the block.
Overrides BlockPluginInterface::build
\Drupal\block\BlockRenderController
public function build() {
$build = array();
$path = drupal_is_front_page() ? '<front>' : current_path();
list($plugin_id, $type) = explode(':', $this
->getPluginId());
$links = language_negotiation_get_switch_links($type, $path);
if (isset($links->links)) {
$build = array(
'#theme' => 'links__language_block',
'#links' => $links->links,
'#attributes' => array(
'class' => array(
"language-switcher-{$links->method_id}",
),
),
);
}
return $build;
}