<?php

/**
* Implements hook_menu().
*/
function first_menu() {
  return array(
    'hello-word' => array(
       'title' => 'Hello word !',
       'route_name' => hello.hello_word,
     )
  );
}

hello.hello_word:
  pattern: '/hello-word'
  defaults:
  	_content: '\Drupal\first\Controller\FirstController::helloWordPage'
  requirements:
  	_permission: 'access content'

<?php

namespace Drupal\first\Controller;

use Drupal\Core\Controller\ControllerBase

/**
* Notre Controller du module first Drupal 8.
*/
class FirstController extends ControllerBase {
  public function helloWordPage() {
    return array(
	'#markup' => t('<p><Hello World/p>'),
    );
  }
}

// Get a value.
$valeur = \Drupal::state()->get('key');
// Multiple key/value pairs:
$pairs = \Drupal::state()->getMultiple($keys);

// Set a value:
\Drupal::state()->set('key','value');
// Set multiple values:
\Drupal::state()->setMultiple($keyvalues);
// Delete a value:
\Drupal::state()->delete('key');

block.admin_add:
  path: '/admin/structure/block/add/{plugin_id}/{theme}'
  defaults:
	_controller: ...
	_title: 'Configure block'
  requirements:
	_permission: 'administer blocks'

mymodule.test:
  path: '/mymodule/test'
  defaults:
	_controller: '\Drupal\mymodule\Controller\Test::getContent'
	_title_callback: '\Drupal\mymodule\Controller\Test::getTitle'

<?php
class Test {

  /**
   * Returns a page title.
   */
  public function getTitle() {
    return  'Foo: ' . \Drupal::config()->get('system.site')->get('name');
  }

  /**
   * Returns a page render array.
   */
  public function getContent() {
    $build = array();
    $build['#markup'] = 'Hello Drupal';
    return $build;
  }
}

$request = \Drupal::request();
$route_match = \Drupal::routeMatch();
$title = \Drupal::service('title_resolver')->getTitle($request, $route_match->getRouteObject());

{{ title_prefix }}  {% if not page %}  <h2{{ title_attributes }}>  <a href="/{{ node_url }}">{{ label }}</a>  </h2>  {% endif %} {{ title_suffix }}