Change URI / Separator to another character.

2008-01-30 Thread MX

Hey folks,

I searched but this subject is due to return non-related results due
to its keywords.

Well im working for a client which needs to mantain half of the
website with the old structure (at least for now). Well I managed to
integrate it very well, but comes a part which goes dead end for me.
The client wrote all the links/images URI like this:

href=link_to_page.php

Well its alright in the root page, but when it enters the /news/view/
1 .. all links/images get broken. Its not a solution to update all
pages (because they are a lot..) but i wanted to know how to change
the / separator to another caracter.

I tried dispatcher but coulndt find anything. I wanted to convert all
CakePHP URI system to news_view_1, etc.

Anyone knows how to do this?

Thanks in advance
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Change URI / Separator to another character.

2008-01-30 Thread Tulio Faria

I guess you could use routes...

Like, Router::connect(/:controller_:action);

I didnt test it here, but I guess it can work...

On 30 jan, 13:40, MX [EMAIL PROTECTED] wrote:
 Hey folks,

 I searched but this subject is due to return non-related results due
 to its keywords.

 Well im working for a client which needs to mantain half of the
 website with the old structure (at least for now). Well I managed to
 integrate it very well, but comes a part which goes dead end for me.
 The client wrote all the links/images URI like this:

 href=link_to_page.php

 Well its alright in the root page, but when it enters the /news/view/
 1 .. all links/images get broken. Its not a solution to update all
 pages (because they are a lot..) but i wanted to know how to change
 the / separator to another caracter.

 I tried dispatcher but coulndt find anything. I wanted to convert all
 CakePHP URI system to news_view_1, etc.

 Anyone knows how to do this?

 Thanks in advance
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Change URI / Separator to another character.

2008-01-30 Thread Samuel DeVore

you might also be able to do a string replace in the
app/config/bootstrap.php file on the value of $_GET['url']  I think it
is fired before things go to the dispacher.

On Jan 30, 2008 10:07 AM, Tulio Faria [EMAIL PROTECTED] wrote:

 I guess you could use routes...

 Like, Router::connect(/:controller_:action);

 I didnt test it here, but I guess it can work...


 On 30 jan, 13:40, MX [EMAIL PROTECTED] wrote:
  Hey folks,
 
  I searched but this subject is due to return non-related results due
  to its keywords.
 
  Well im working for a client which needs to mantain half of the
  website with the old structure (at least for now). Well I managed to
  integrate it very well, but comes a part which goes dead end for me.
  The client wrote all the links/images URI like this:
 
  href=link_to_page.php
 
  Well its alright in the root page, but when it enters the /news/view/
  1 .. all links/images get broken. Its not a solution to update all
  pages (because they are a lot..) but i wanted to know how to change
  the / separator to another caracter.
 
  I tried dispatcher but coulndt find anything. I wanted to convert all
  CakePHP URI system to news_view_1, etc.
 
  Anyone knows how to do this?
 
  Thanks in advance
 




-- 
-- 
(the old fart) the advice is free, the lack of crankiness will cost you

- its a fine line between a real question and an idiot

http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/
http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/
http://blog.samdevore.com/cakephp-pages/i-cant-bake/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Change URI / Separator to another character.

2008-01-30 Thread AD7six



On Jan 30, 6:23 pm, Samuel DeVore [EMAIL PROTECTED] wrote:
 you might also be able to do a string replace in the
 app/config/bootstrap.php file on the value of $_GET['url']  I think it
 is fired before things go to the dispacher.


if you want to use a different separator here's the 3 point plan:

1) in the bootstrap to change $_GET['url'] such that x-y-z becomes x/y/
z so that the router works normally.
2) in your AppHelper url method edit such that it calls the router and
replaces /s with - as appropriate
3) override your controller redirect method so that it also calls the
router and replaces /s with - before redirecting.

In that way, and especially if you use array urls, you get the
flexibility of making the url look like you want without the potential
headaches of using string urls and (overly) custom route definitions.

hth,

AD
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Change URI / Separator to another character.

2008-01-30 Thread MX

That was the most simple solution :D

But I just did 2 things. Edited dispatcher.php, function dispatch.
And edited Router::url to convert / to _..

:D Thanks a lot

On Jan 30, 6:25 pm, AD7six [EMAIL PROTECTED] wrote:
 On Jan 30, 6:23 pm, Samuel DeVore [EMAIL PROTECTED] wrote:

  you might also be able to do a string replace in the
  app/config/bootstrap.php file on the value of $_GET['url']  I think it
  is fired before things go to the dispacher.

 if you want to use a different separator here's the 3 point plan:

 1) in the bootstrap to change $_GET['url'] such that x-y-z becomes x/y/
 z so that the router works normally.
 2) in your AppHelper url method edit such that it calls the router and
 replaces /s with - as appropriate
 3) override your controller redirect method so that it also calls the
 router and replaces /s with - before redirecting.

 In that way, and especially if you use array urls, you get the
 flexibility of making the url look like you want without the potential
 headaches of using string urls and (overly) custom route definitions.

 hth,

 AD
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---