Tuesday, June 3, 2014

Hide Function parameter from URL when a request is made

I want to hide the action parameters from my url when a request to a particular action is made. For instance, 

    <?php 
      
       echo $this->Html->url(array('controller' => 'controllerName', 'action' => 'actionName', parameter1, $parameter2)); 
     ?>
     
The above code will generate url:

      controllerName/actionName/1/123


What I want to achieve is, when users clicks on such urls, the `param1 (= 1)` and `param2 (= 123)` shouldn't be visible to him, and link should be like,


      controllerName/actionName    /* no attribute visible */

Is this possible? How I can achieve this, I was reading about Routing, but couldn't get how to achieve this !

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

No comments: