Creating a simple first module I am a total beginner with Drupal and am trying to create a very simple "Hello world" module. I've been following the guide "A Hello World custom page module", but I still get a "Page not found" message.

My directory structure looks like this:

    drupal
        modules
            custom
                mymodule
                    src
                     |- Controller
                     |     ExampleController.php
                     |- mymodule.info.yml
                     |- mymodule.routing.yml


The module shows up in the admin panel, and I have activated it. 

Here's what my routing file looks like: 

mymodule.content:
  path: '/example'
  defaults:
    _controller: '\Drupal\mymodule\Controller\ExampleController::content'
    _title: 'Hello World'
  requirements:
    _permission: 'access content'


Here's mymodule.info.yml:

name: Hello World Module
description: Creates a page showing "Hello World".
package: custom

type: module
core: 8.x

dependencies:
  - datetime
  - link
  - views

configure: hello_world.settings

hidden: false

# Note: do not add the 'version'  property yourself!
# It will be added automatically by the packager on drupal.org.
version: 1.0


And here's the controller:

/**
* @file
* Contains \Drupal\mymodule\Controller\ExampleController.
*/

namespace Drupal\mymodule\Controller;

use Drupal\Core\Controller\ControllerBase;

class ExampleController extends ControllerBase {

    /**
    * {@inheritdoc}
    */
    public function content() {
        $build = array(
        '#type' =&gt; 'markup',
        '#markup' =&gt; t('Hello World!'),
    );
    return $build;
    }

}


When I go to  Configuration/Development/Performance and click "Clear all caches" I get this error message:

ReflectionException: Class \Drupal\mymodule\Controller\ExampleController does not exist in ReflectionMethod-&gt;__construct() (line 128 of core/lib/Drupal/Core/Entity/EntityResolverManager.php).


I have tried experimenting with the directory structure, for example moving mymodule up directly to modules instead of custom, but to no avail. What am I doing wrong?
Well, this is embarrassing... By blindly following the guide I forgot to add &lt;?php to the beginning of ExampleController.php. All these new .yml-files made me forget all about "normal" PHP I guess. Problem solved.