Page 1 of 1

[Solved] Problem with Pretty URL

Posted: Tue Apr 15, 2008 5:16 pm
by s7orm
Hi,

I have an (understanding) problem with the pretty URL idea.
I read the tutorial on the cmsms website and I did the same with my own module:
1. I extended the SetParameters() function with:

Code: Select all

$this->RegisterRoute('/hands\/(?P<selectedhand>[0-9]+)\/(?P<returnid>[0-9]+)$/', array('action'=>'default'));
(e.g.)
2. I modified one of the links:

Code: Select all

$this->CreateLink($id, 'viewhand', $returnid, $temp_h, array('selectedhand'=>$row['id']), '', '', '', '', '', [b]'hands/'.$row['id'].'/'.$returnid[/b]);
(e.g)

I get no error message - I have a list with some objects and when I select 1 of them the linkbar in my browser says www.blabla.com/index.php/hands/156/18/, but the specified object details are not shown, but the list (with all objects) instead.

Am I missing something?

Thanks in advance.

Re: Problem with Pretty URL

Posted: Tue Apr 15, 2008 5:24 pm
by calguy1000
the registerroute function will not call the appropriate action by itself, you need to tell it what action

or do it in the action.defaulturl.php file.

Re: Problem with Pretty URL

Posted: Wed Apr 16, 2008 8:17 am
by s7orm
Thanks for the reply. Can you give me an example, because this is not documented in the tutorial?

Re: Problem with Pretty URL

Posted: Wed Apr 16, 2008 10:33 am
by s7orm
problem solved

Re: Problem with Pretty URL

Posted: Wed Apr 16, 2008 6:43 pm
by Pierre M.
Hello,
s7orm wrote: problem solved
feel free to improve the wiki with your hints and feedback.

Pierre M.