I did a custom module, but i can't see the page with the URL : Page not found. I can install the module and activiate, but i can't go on the page.
This is the code :
hello_world.hello_world:
path: '/helloworld'
defaults:
_controller: 'Drupal\hello_world\Controller\HelloWorldController::helloWorld'
_title: 'Hello World'
requirements:
_permission: 'access content'
name: Hello World
core: 8.x
type: module
package: Tutos
description: Mini module test Drupal 8
<?php
/**
* @file
* Contains \Drupal\hello_world\Controller\HelloWorldController.
*/
namespace Drupal\hello_world\Controller;
use Drupal\Core\Controller\ControllerBase;
/**
* Controller routines for hello_world module routes.
*/
class HelloWorldController extends ControllerBase {
/**
* Return the 'Hello World' page.
*
* @return string
* A render array containing our 'Hello World' page content.
*/
public function helloWorld() {
$output = array();
$output['hello_world'] = array(
'#markup' => $this->t('Hello World!'),
);
return $output;
}
}