Re: route confusion

2007-05-03 Thread AD7six



On 2 mayo, 17:16, monty <[EMAIL PROTECTED]> wrote:
> after reading some of the posts i'm a bit confused about routes
>
> on my local machine I have
> localhost/app/pub/action1
> localhost/app/pub/action2 etc..
>
> I want my links to be like echo $html->link('go here','/action1') to
> go to /pub/action1 etc..
>
> I want this to work the same on local and live server. Is this what
> routes are for or should I use mod rewrite?
>
> I tried $Route->connect ('/*', array('controller'=>'pub',
> 'action'=>'display'));
>
> Much appreciated, Simon.

http://bakery.cakephp.org/articles/view/custom-urls-from-the-site-root


--~--~-~--~~~---~--~~
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: route confusion

2007-05-02 Thread robechar

If you have only a couple of actions that use this, it is probably
best to list those individually in your routes.php file like:
$Route->connect ('/action1', array('controller'=>'pub',
'action'=>'action1'));
$Route->connect ('/action2', array('controller'=>'pub',
'action'=>'action2'));
...

You could also do it the way you had posted, however it it will break
anything that doesn't go to your 'pub' controller.
$Route->connect ('/*', array('controller'=>'pub')); // Wouldn't
recommend this.

So when you tried to go to /othercontroller/action, it would still be
going to the 'pub' controller and try to run a 'othercontroller'
action with the param 'action'

If you have a lot of actions in your pub controller, it is really
easiest to just keep the controller in the URI.  On a side note, you
can also link within the pub controller by getting rid of your '/', as
long as you are in the pub controller: $html->link('go
here','action1')

Hope that helps.


On May 2, 8:16 am, monty <[EMAIL PROTECTED]> wrote:
> after reading some of the posts i'm a bit confused about routes
>
> on my local machine I have
> localhost/app/pub/action1
> localhost/app/pub/action2 etc..
>
> I want my links to be like echo $html->link('go here','/action1') to
> go to /pub/action1 etc..
>
> I want this to work the same on local and live server. Is this what
> routes are for or should I use mod rewrite?
>
> I tried $Route->connect ('/*', array('controller'=>'pub',
> 'action'=>'display'));
>
> Much appreciated, Simon.


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



route confusion

2007-05-02 Thread monty

after reading some of the posts i'm a bit confused about routes

on my local machine I have
localhost/app/pub/action1
localhost/app/pub/action2 etc..

I want my links to be like echo $html->link('go here','/action1') to
go to /pub/action1 etc..

I want this to work the same on local and live server. Is this what
routes are for or should I use mod rewrite?

I tried $Route->connect ('/*', array('controller'=>'pub',
'action'=>'display'));

Much appreciated, Simon.


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