title: Drupal 8 list taxonomy terms
body: <p>What is best way to retrieve Drupal 8 taxonomy terms and pass array to twig template?</p>
  
  <p>Now I have:</p>
  
  <p>In template.theme</p>
  
  <pre><code>function template_preprocess_page(&amp;$variables) {
  
      $variables['some_term'] = \Drupal::service('entity_type.manager')-&gt;getStorage("taxonomy_term")-&gt;loadTree('some_term', $parent = 0, $max_depth = NULL, $load_entities = FALSE);
  
  }
  </code></pre>
  
  <p>Now in page.html.twig I can access {{ some_term }} array.</p>
  
  <p>I feel that something is wrong about this. What is the best way to achieve this? I just need an array of selected taxonomy terms in page.html.twig. I want to use it to build custom HTML code.</p>
  
  <p>Equivalent function in Wordpress is simple get_terms().</p>