Create custom page from simple module

Creating a custom page menu  from simple module in drupal has became little tough when compare drupal 6 and 7. (custom page creation)

So, Steps to create custom page menu in drupal 8  without hook_menu as you do in drupal 6 and 7 with it. 

Basically now in drupal 8 you have to create controller, routes.yml and basic info file for your module

Steps

1. First you need to create

yourmodulename    folder inside drupal 8 modules folder, then create info file thatis 

yourmodulename.info.yml

name: 'Your Module name'
description: 'Decription'
package: 'If needed'
type: module
core: 8.x

then create yourmodulename.routing.yml

yourmodulename.anything:
 path: '/anything'
 defaults:
  _controller: '\Drupal\yourmodulename\Controller\CustomController::someMethodInController'
  _title: 'Your custom title'
 requirements:
  _permission: 'any permission you want'

now create controller file 

everything you doing here is inside your module

now create a file inside your module in a path src\Controller\CustomController.php 

<?php

/**
 * @file
 * Contains \Drupal\youmodulename\Controller\CartController.
 */

namespace Drupal\youmodulename\Controller;
use Drupal\Core\Controller\ControllerBase;

/**
 * Contains the custom controller.
 */
class CustomController extends ControllerBase
{
 
  public function someMethodInController() {
    return array(
          '#type' => 'markup',
          '#markup' => "simply to say hello",
          );
  }

}

Enable your module and load your page at anything, Thats it

bye