Use MenulinkTree::load in page_preprocess I'm on drupal 8, and i want to get menu links from the main menu in order to create the same menu for mobile (so i need 2 same menu, with differents rendering)

I use like this : 

function template_preprocess_page(&amp;$variables) {
    $variables['menu'] = \Drupal\Core\Menu\MenuLinkTree::load('main');
}


But it's broke my website.

What do you think about that ?
It is because you don't use a second (mandatory) parameter. Look at this example:

$menu_name = 'main';
$menu_tree_service = \Drupal::service('menu.link_tree');
$menu_parameters = new \Drupal\Core\Menu\MenuTreeParameters();
$menu_parameters-&gt;setMaxDepth(1);
$tree = $menu_tree_service-&gt;load($menu_name, $menu_parameters);


You could also set a root menu item like this:

$menu_parameters-&gt;setRoot($root_menu_item-&gt;getPluginId());


To get the menu link title and url:

foreach ($tree as $item) {
  $title = $item-&gt;link-&gt;getTitle();
  $url = $item-&gt;link-&gt;getUrlObject()-&gt;toString();
}