How to pass variable from block and access in it twig template I'm trying to make custom block but I have problem accessing variables in template. 

My block code:
    

namespace Drupal\more_topics_rollout\Plugin\Block;
use Drupal\Core\Block\BlockBase;
/**
 *
 * @Block(
 *  id = "more_topics_rollout",
 *  admin_label = @Translation("More topics rollout"),
 *  category = @Translation("Blocks")
 * )
 */
class more_topics_rollout_block extends BlockBase {
    /**
     * {@inheritdoc}
     */
    public function build() {
        return array(
            '#title' =&gt; 'More topics'
        );
    }
}
?&gt;


My module file:

function more_topics_rollout_theme($existing, $type, $theme, $path) {
    return array('more_topics_rollout' =&gt;
        array(
            'variables' =&gt; array(
                'title' =&gt; null,
                'body' =&gt; null,
                'description' =&gt; null
            ),
            'template' =&gt; 'block--more-topics-rollout'
        )
    );
}


And when I'm trying to display title with {{ title }} it doesn't render. When I'm trying to access variables I know for sure don't exist like {{ dasdasda }} it doesn't throw any errors. Can someone explain this behavior to me?
Can someone explain this behavior to me?

The render array returned by the build method in the block plugin does not have a theme or type. This means that it will default to markup (iirc). The theme/template is not being used because the render array does not specify to use it.

You can find an example of implementing render arrays on drupal.org's documentation page, Render arrays. This explains the default element properties.

How to pass variable from block and access in it twig template?

The render array should have the #theme element property set to the theme definition key.

  public function build() {
    return [
      '#theme' =&gt; 'more_topics_rollout',
      '#title' =&gt; $this-&gt;t('More Topics'),
      '#body' =&gt; 'My body',
      '#description' =&gt; 'My description'
    ];
  }