Hi thdz.x,

On Dec 29, 2:06 am, "thdz.x" <[EMAIL PROTECTED]> wrote:
> $Route->connect('/', array('controller' => 'main');
> //you'll need to specify controllers that don't fit into the ArtistName
> construct
> $Route->connect('/admin/', array('controller' = 'admin');
> $Route->connect('/:artistname/:controller/:action/:id',
> array('controller' => 'artists'));I think the whole point is simply that I 
dont understand the
Route->connect - Syntax. In the manual they say
"URL is the regular expression Cake URL you wish to map"
but "/blog/*" and ":something" isnt a regex.

what does the ":" mean?

It's a marker, such that whatever is in the place of ":myParam" will
become array('myParam'=>'whatever matched in the regex'). if it's
:controller it's the name of the controller to use, if it's :action
it's the method to run otherwise it's (just) a named parameter

can i use the "?" in the urls?

You can use anything that you can use in a regex. Here's an example:
https://cakeforge.org/plugins/scmsvn/viewcvs.php/1.1/trunk/bakesale/config/routes.php?rev=223&root=bakesale&view=markup



2. why shouldnt we/i use mod_rewrite?

You are using mod_rewrite. Otherwise you would need to create the
folder structure to represent your url structure etc.
If you don't have mod_rewrite the same result is achieved by adjusting
your app to use and expect urls of the form
domain.com/index.php/controller/action/etc

3. when i have to "hard-code/-route" each action, isnt it better the
other way around. route /controller/action as default and catch the
"not-found"-error: when an action/method is not present in the
controller call a default method that looks if the given param is an
ArtistName or AlbumName or something like that. when everything fails
throw a 404.

You could do that if you want, making use of an app_error class. It's
slightly involved so I won't try to explain, but by the time you have
developed your app how to do that would become clear enough. That said,
the act of deducing that the existing routes don't match anything are
relatively expensive so not sure that's such a good idea.

4. what do you think when i would
simply rewrite/-route (silently)
/domain.com/ArtistName/comment/add/
to
/domain.com/comment/add/ArtistName/

the difference between
/domain.com/comment/add/XXX/
and
/domain.com/comment/add/YYY/
could then be: use a diffenrent view or a different layout-file.

You mean is it a good idea to use a route to do that? Sure.


greetings
thdz.x

HTH,

AD7six
Please note:
The manual/bakery is a good place to start any quest for info.
The cake search (at the time of writing) erroneously reports less/no
results for the google group.
The wiki may contain incorrect info - read at your own risk (it's
mainly user submitted) :) You may get your answer quicker by asking on
the IRC Channel (you can access it with just a browser
here:http://irc.cakephp.org).


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to