title: TYPO3 How to handle routes for custom extensions
body: <p>Lat's say that I've got hypothetical <strong>ZOO</strong> extension, which has just <strong>Animal</strong> model, and <strong>Showroom</strong> plugin for displaying simple <code>list</code> and <code>show</code> actions. Very basic case so far.</p>
  <p><strong>Animal</strong> model contains just two fields <code>name</code> which is supposed to be URI part and <code>color</code>... just color.</p>
  <p>SQL for it is just</p>
  <pre class="lang-sql prettyprint-override"><code>CREATE TABLE tx_zoo_domain_model_animal (
      name varchar(255) DEFAULT '' NOT NULL,
      color varchar(255) DEFAULT '' NOT NULL,
  );
  </code></pre>
  <p>For linking to the single view (<code>show</code> action) we can use simple URI w/out route enhancer:</p>
  <pre><code>/zoo?tx_zoo_showroom[action]=show&amp;tx_zoo_showroom[animal]=123&amp;tx_zoo_showroom[controller]=Animal&amp;cHash=17c7b0009b50eaf0222fe66d9f
  </code></pre>
  <p>Next, to add routing for our extension we'd like to add such enhancer within <code>typo3conf/sites/yoursite/config.yaml</code></p>
  <pre class="lang-yaml prettyprint-override"><code>routeEnhancers:
    Zoo:
      type: Extbase
      limitToPages:
        - 107  # it's always good idea to limit enhancers only to pages containing plugin
      extension: Zoo
      plugin: Showroom
      routes:
        - routePath: '/'
          _controller: 'Animal::list'
        - routePath: '/{animal-name}'
          _controller: 'Animal::show'
          _arguments:
            animal-name: animal
      aspects:
        animal-name:
          type: PersistedAliasMapper
          tableName: tx_zoo_domain_model_animal
          routeFieldName: name
  </code></pre>
  <p>which results with a link like <code>http://domain.tld/zoo/Elephant</code></p>
  <p>so far, so good, anyway we meet several problems here:</p>
  <ul>
  <li>URI isn't lowercase</li>
  <li>it doesn't replace spaces so if we have an animal with <em>Ultra Weird Fish</em> name the URI will be <code>http://domain.tld/zoo/Ultra%20Weird%20Fish</code> instead of <code>http://domain.tld/zoo/ultra-weird-fish</code></li>
  <li>it doesn't care about uniqueness, so when we'll add several animals i.e. with Fish name, but different color it will create the same URI for all of them: <code>http://domain.tld/zoo/Ultra%20Weird%20Fish</code></li>
  </ul>
  <p>How to properly handle this scenario?</p>