title: How pass to id and slug in url CakePHP 3
body: <p>I have a function view, and i pass 2 parameters, $id and $slug, 
  I want example.com/slug-id, then in my routes.php i have</p>
  
  <pre><code>   Router::connect(
  '/view/:id-:slug', 
  ['controller' =&gt; 'Posts', 'action' =&gt; 'view'],
  [
      'pass' =&gt; ['id', 'slug'],
      'id' =&gt; '[0-9]+'
  ]
  </code></pre>
  
  <p>);
  And my function is </p>
  
  <pre><code>public function view($slug = null, $id = null){
      // Time Format
      Time::setToStringFormat('dd-MM-YYYY');
  
      if(!$id)
          throw new NotFoundException('error !');
  
      $post = $this-&gt;Posts-&gt;get($id);
  
      if($slug != $post-&gt;slug)
          throw new NotFoundException("error");
      $this-&gt;set(compact('post'));
  
  }
  </code></pre>
  
  <p>But why when i go to example.fr/posts/view/test-1</p>
  
  <p>I have a NotFoundException ?</p>