Convert hook_menu in drupal 8
The routing system uses pattern matching. You can define a parameter in the path that will be used as a variable. 

If we look at this snippet of node.routing.yml:

node.add:
  path: '/node/add/{node_type}'
  defaults:
    _controller: '\Drupal\node\Controller\NodeController::add'
    _title_callback: '\Drupal\node\Controller\NodeController::addPageTitle'
  requirements:
    _node_add_access: 'node:{node_type}'
  options:
    _node_operation_route: TRUE
    parameters:
      node_type:
        with_config_overrides: TRUE


You can see the {node_type} in the path. This variable will contain the node type as specified in the path. You can use that as part of the requirement as you can see above, and it will also be available to your functions. \Drupal\node\Controller\NodeController::add receives the node_type variable as well:

public function add(NodeTypeInterface $node_type) {
  $node = $this-&gt;entityManager()-&gt;getStorage('node')-&gt;create(array(
    'type' =&gt; $node_type-&gt;id(),
  ));

  $form = $this-&gt;entityFormBuilder()-&gt;getForm($node);

  return $form;
}


Read Parameters in routes for more information.

And for forms:

example.user_form
  path: 'example/form/{user}'
  defaults:
    _form: '\Drupal\example\Form\ExampleForm'
  requirements:
    _permission: 'access content'


You can use the buildForm function and place the additional parameters after $form and $form_state.

namespace Drupal\example\Form;

use Drupal\Core\Form\FormBase;
use Drupal\Core\Session\AccountInterface;

class BasicForm extends FormBase {

 public function buildForm(array $form, FormStateInterface $form_state, AccountInterface $user = NULL) {
    // Do something with $user in the form
  }
}