routes rewrite

I need url structure: /class.method/param1/value1/param2/value2/format/formatValue

Any hint how to handle this?

I think this will work:
$route['(.+?)\.(.+?)/(.*)'] = '$1/$2/$3';

I need something else

I need restfull url /class.method/param1/value1/param2/value2 so I need to rewrite into param1=value1&param2=value2 or...

function method($param1, $param2)

So... what if somebody call /class.method/param2/value2/param1/value1

Here is example

user.list/category/software/page/2 is same with

Maybe it's just me... but people shouldn't just be able to call methods any old way they want... there has to be some kind of rule that needs to be enforced at some point. Otherwise you'll end up driving yourself with endless what ifs... I've seen it happen... never pretty. Even a car enforces rules at some point, you can't just shift gears unless first disengaging the clutch.


How about leaving your parameters out of the arguments for your method. Call them from inside the method by using:
function method(){
  $params = $this->uri->uri_to_assoc();
  $params = $this->uri->ruri_to_assoc(); //for routed uri

Now you've got a set of key=>value pairs to use to your liking.

It is likely to other variable or function definition. I could see from my code provides an example, you should want to use bases, in addition to showing you the route it may be a route map to the other route. You can easily replace the "MyModule's / mycontroller / ([0-9] +)" to "([a, miscellaneous - Z of ]+)/([ a miscellaneous - Z of ]+)/([ 0-9] +) "and then map 1 to module 2 to the controller.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.