Hi,
I need to transport some kind of ID (it could also be a Session-ID)
through the URL. This could look like this: http://domain.com/ID1234/posts/edit
or http://domain.com/ID7895/users/
This ID can easily be identified by a RegEx.
The problem is how can cake pass this ID **automatically** to every
other cake-generated URL on this page (like with html->link(), form-
>create() or redirect() - which all based on Router::url)? Do I have
to write my own link() and form() functions?
The easiest way would be to store this ID in a session, but I need to
have different IDs in one browsersession and to access all pages
directly, so I have to have the ID in the url.
I tried to set up a route:
Router::connect('/:MyID/:controller/:action/*',array(),array('MyID' =>
'ID[0-9]{4}'));
but it did not work. Then I added something like this to core.php:
ereg("/(ID[0-9]{4})/",$_SERVER["REQUEST_URI"],$MyID);
if ($MyID[1]) define ('BASE_URL', "/".$MyID[1]);
this worked reasonably but the value of $this->here is incorrect
afterwards and it seemed to me that this is not a good way to do it.
Have you any ideas how to accomplish this? THANKS!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---