How I can overwrite Router::url() in my app


#1

I need to overwrite Router::url() function for decoding params,
So how I can overwrite this function in my app?

We use CakePHP version 2.10.12


#2

Why do you need to do that? Is there something that declaring custom routes won’t solve for you?


#3

Yes, I want to encode all parameters in url before show up


#4

Are you just looking to encode the parameters (IDs, etc.), or the controller and action too?


#5

No only the parameters (IDs, etc.)


#6

Perhaps you can deal with them in AppController::beforeFilter, changing $this->request->params?


#7

Yes I already did this for decoding the params,
but I want to show up the IDs as decoded in URL to prevent any one know it or change it.

Thnaks Zuluru =)


#8

I’m confused now. Maybe examples would make it clearer.