title: CakePHP URL [Underscore to Hyphen]
body: <p>I need some help about cakephp url underscore to hyphen.</p>
  
  <p>I've search already over the internet but cannot find the answer.</p>
  
  <p>I followed the instruction in Cakephp(dot)org</p>
  
  <blockquote>
    <p><a href="http://book.cakephp.org/2.0/en/development/routing.html#passing-parameters-to-action" rel="nofollow noreferrer">http://book.cakephp.org/2.0/en/development/routing.html#passing-parameters-to-action</a></p>
  </blockquote>
  
  <p>But still not working</p>
  
  <p>What I wanted is to change the url</p>
  
  <p>dashboard/view_profile to dashboard/view-profile</p>
  
  <p>Controller : DashboardController</p>
  
  <p>Action : view_profile</p>
  
  <p>View : view_profile.ctp</p>
  
  <p>Routes.php</p>
  
  <pre><code>Router::connect(
                  'dashboard/:slug', 
                  array('controller' =&gt; 'dashboard', 'action' =&gt; 'view_profile'),
                  array('pass' =&gt; array('slug'))
                  );
  </code></pre>
  
  <p>Link :</p>
  
  <p><code>&lt;?php echo $this-&gt;Html-&gt;link('View Profile', array('controller' =&gt; 'dashboard', 'action' =&gt; 'view_profile', 'slug' =&gt; 'view-profile')); ?&gt;</code></p>
  
  <p>Error :</p>
  
  <pre><code> Error: The action view-profile is not defined in controller DashboardController
  
  Error: Create DashboardController::view-profile() in file: app\Controller\DashboardController.php.
  
  &lt;?php
  class DashboardController extends AppController {
  
  
      public function view-profile() {
  
      }
  
  }
  </code></pre>