Hey,
I like your preg_match rule too, it seems like a good idea for legacy
compatibility. If I find time I could create a more complex $from_url
Router that would allow us to preg_replace and other techniques to get
the shop done, which could give a little more options then the standard
CakePHP router. However, the more we move away from the conventions the
more issues we might experience with Controller::base, Controller:here,
etc., so actually I shouldn't create this class, I think : p.
Thanks for your comment so ; ).
tjquoll schrieb:
That's pretty cool. I've been playing with a similar idea in a cms I'm
building for our main business site. I've been searching the code
looking for an alternative to doing the "foreach
($paths->controllerPaths as $path)" trick to get the controller names
but haven't found any otherway yet.
To Cakeify small legacy html sites I've been doing something like
if(preg_match("/^(.*)\.html/i","$from_url", $matches)){
$from_url = "pages/".$matches[1];
}
in routes.php to map .html files in / to /pages.
eg. /file.html goes to /pages/file
Felix Geisendörfer wrote:
I think I've already created what you are looking for. Good luck with it
; ):
http://www.thinkingphp.org/2006/05/17/url-aliases-for-cakephp/
I only use it on my webdesign page (see below), but it seems to work
pretty well so far.
Best Regards,
Felix Geisendörfer aka the_undefined
--------------------------
http://www.thinkingphp.org
http://www.fg-webdesign.de
JohnRobert schrieb:
Before I begin, I'm quite new to cake php (about 2 days using it). So
far so good!
Before I can fully commit, I need to be able to create static pages
under / rather than only under /pages/. I had a go at changing some
routes, to no avail!
Before we continue, I'd also like to note I want /news/ /edit/ etc.. to
behave in the default manner, i.e - running their equvilent controller
and doing what they'ed do on a fresh install, so / isn't *only* a place
for static pages, but also a few controllers of my choosing.
I'd imagine this requires defining each controller in the routes
config, I'm just not too sure how to do it, I found the manual a bit
confusing.
--------------090608090300010103060907
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: quoted-printable
X-Google-AttachSize: 1707
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
I think I've already created what you are looking for. Good luck with
it ; ):<br>
<br>
<a href="" class="moz-txt-link-rfc2396E" href="http://www.thinkingphp.org/2006/05/17/url-aliases-for-cakephp/">"http://www.thinkingphp.org/2006/05/17/url-aliases-for-cakephp/">http://www.thinkingphp.org/2006/05/17/url-aliases-for-cakephp/</a><br>
<br>
I only use it on my webdesign page (see below), but it seems to work
pretty well so far.<br>
<br>
Best Regards,<br>
Felix Geisendörfer aka the_undefined<br>
<div class="moz-signature"><small>--------------------------<br>
<a href="" class="moz-txt-link-rfc2396E" href="http://www.thinkingphp.org">"http://www.thinkingphp.org">http://www.thinkingphp.org</a><br>
<a href="" class="moz-txt-link-rfc2396E" href="http://www.fg-webdesign.de">"http://www.fg-webdesign.de">http://www.fg-webdesign.de</a>
</small></div>
<br>
<br>
JohnRobert schrieb:
<blockquote
cite="" class="moz-txt-link-rfc2396E" href="mailto:[EMAIL PROTECTED]">"[EMAIL PROTECTED]"
type="cite">
<pre wrap="">Before I begin, I'm quite new to cake php (about 2 days using it). So
far so good!
Before I can fully commit, I need to be able to create static pages
under / rather than only under /pages/. I had a go at changing some
routes, to no avail!
Before we continue, I'd also like to note I want /news/ /edit/ etc.. to
behave in the default manner, i.e - running their equvilent controller
and doing what they'ed do on a fresh install, so / isn't *only* a place
for static pages, but also a few controllers of my choosing.
I'd imagine this requires defining each controller in the routes
config, I'm just not too sure how to do it, I found the manual a bit
confusing.
</pre>
</blockquote>
</body>
</html>
--------------090608090300010103060907--
--~--~---------~--~----~------------~-------~--~----~
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 -~----------~----~----~----~------~----~------~--~---
|