Re: named params and prefix routing

2009-01-07 Thread Marcelius

Thank you for all the suggestions!!

Sadly even with copying Andras Kende's code, it still doesn't work for
me (Cake 1.2). I ended up with writing an AppHelper::url method which
adds prefixes where needed.

I do appreciate your help!

Marcel.

On 7 jan, 19:18, "Andras Kende"  wrote:
> Hello,
>
> I had similar problems with prefix routing; pagination; sorting; links
>
> I end up with this route.php and everything seems to work well now
>
> all my views are plain without any prefix settings etc...
>
>      Router::connect('/', array('controller' => 'pages', 'action' =>
> 'display', 'home'));
>
>     $parts = explode('/',$_SERVER['REQUEST_URI']);
>     $area = $parts[1];
>     $areas = array("admin", "nurse", "practice");
>     if (in_array($area,$areas)){
>     Router::connect("/".$area."", array("controller"=>"page",
> "prefix"=>$area, "action"=>"index", $area));
>     Router::connect("/".$area."/:controller/:action", array("prefix"=>$area,
> "".$area.""=>true));
>     Router::connect("/".$area."/:controller/:action/*",
> array("prefix"=>$area, "".$area.""=>true));
>     Router::connect("/".$area."/:controller/:action/*",
> array("prefix"=>$area));
>     }
> ?>
>
> Andras
>
> On Wed, Jan 7, 2009 at 1:10 PM, Phil  wrote:
>
> > Thanks for your idea - I just tried it, but interestingly, it doesn't
> > work (i.e. the prefix is not set), but there's also no named parameter
> > "prefix" appended to the url - it's completely ignored, as it seems.
>
> > On 7 Jan., 18:55, brian  wrote:
> > > I've not used prefix routing myself but have you tried setting
> > > 'prefix' in the link method?
>
> > > $html->link('alle Termine', array('controller' => $params
> > > ['controller'], 'action' => 'entries', 'prefix' => 'intranet', 'future'
> > =>
> > > '0'));
>
> > > On Wed, Jan 7, 2009 at 7:35 AM, Phil  wrote:
>
> > > > Same problem here - these are my routes:
>
> > > > Router::connect('/intranet/', array('controller' => 'users', 'action'
> > > > => 'index', 'prefix' => 'intranet', 'intranet' => true));
> > > > Router::connect('/intranet/:controller/:action/*', array('prefix' =>
> > > > 'intranet', 'intranet' => true));
>
> > > > Works fine, except for creating a link with a named parameter:
>
> > > > $html->link('alle Termine', array('controller' => $params
> > > > ['controller'], 'action' => 'entries', 'intranet'=>true, 'future' =>
> > > > '0'));
>
> > > > creates this link:
>
> > > > /calendar_entries/entries/intranet:1/future:1
>
> > > > instead of:
>
> > > > /intranet/calendar_entries/entries/future:1
>
> > > > Anything new about this problem here?
>
> > > > TIA, Phil
>
> > > > Marcelius schrieb:
> > > >> I'm usually not the guy who bumbs postings but this problem still
> > > >> exists... So my question is: is this behavior by design or am I doing
> > > >> something wrong?
>
> > > >> On 12 dec, 07:53, Marcelius  wrote:
> > > >> > Thanks for the anwser but that didn't work here.
>
> > > >> > The be more clear: If I do not usenamedparams, the the url is
> > > >> > correct: It has the prefix /owner
> > > >> > If I do usenamedparams, the router adds owner:1 as anamedparam
> > > >> > instead of prepending the /owner prefix.
>
> > > >> > So:
> > > >> > Router::url(array("controller"=>"invoices", "action"=>"edit", 5,
> > > >> > "owner"=>true, "key"=>"val"));
>
> > > >> > Returns and not expected:
> > > >> > "/invoices/edit/5/owner:1/key:val"
> > > >> > I would expect:
> > > >> > "/owner/invoices/edit/5/key:val"
>
> > > >> > On 11 dec, 16:31, Lane  wrote:
>
> > > >> > > What were you expecting the Router to return if not
> > "/invoices/edit/5/
> > > >> > > owner:1/key:val"?
>
> > > >> > > On Dec 11, 4:39 am, Marcelius  wrote:
>
> > > >> > > > Hello!
>
> > > >> > > > I have this route like the manual says for prefix routing:
>
> > > >> > > > Router::connect('/owner/:controller/:action/*', array
> > > >> > > > ('prefix'=>'owner', 'owner'=>true));
>
> > > >> > > > This works fine until I want to create a url with
> > somenamedparamsin
> > > >> > > > it:
>
> > > >> > > > Router::url(array("controller"=>"invoices", "action"=>"edit", 5,
> > > >> > > > "owner"=>true));
> > > >> > > > returns "/owner/invoices/edit/5" as expected.
>
> > > >> > > > Router::url(array("controller"=>"invoices", "action"=>"edit", 5,
> > > >> > > > "owner"=>true, "key"=>"val"));
> > > >> > > > returns "/invoices/edit/5/owner:1/key:val" not as expected.
>
> > > >> > > > Something wrong in my routes? Please note that that's the only
> > route
> > > >> > > > available.
>
> > > >> > > > Thanks in advance!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: named params and prefix routing

2009-01-07 Thread Andras Kende
Hello,

I had similar problems with prefix routing; pagination; sorting; links

I end up with this route.php and everything seems to work well now

all my views are plain without any prefix settings etc...

 'pages', 'action' =>
'display', 'home'));

$parts = explode('/',$_SERVER['REQUEST_URI']);
$area = $parts[1];
$areas = array("admin", "nurse", "practice");
if (in_array($area,$areas)){
Router::connect("/".$area."", array("controller"=>"page",
"prefix"=>$area, "action"=>"index", $area));
Router::connect("/".$area."/:controller/:action", array("prefix"=>$area,
"".$area.""=>true));
Router::connect("/".$area."/:controller/:action/*",
array("prefix"=>$area, "".$area.""=>true));
Router::connect("/".$area."/:controller/:action/*",
array("prefix"=>$area));
}
?>

Andras


On Wed, Jan 7, 2009 at 1:10 PM, Phil  wrote:

>
> Thanks for your idea - I just tried it, but interestingly, it doesn't
> work (i.e. the prefix is not set), but there's also no named parameter
> "prefix" appended to the url - it's completely ignored, as it seems.
>
> On 7 Jan., 18:55, brian  wrote:
> > I've not used prefix routing myself but have you tried setting
> > 'prefix' in the link method?
> >
> > $html->link('alle Termine', array('controller' => $params
> > ['controller'], 'action' => 'entries', 'prefix' => 'intranet', 'future'
> =>
> > '0'));
> >
> > On Wed, Jan 7, 2009 at 7:35 AM, Phil  wrote:
> >
> > > Same problem here - these are my routes:
> >
> > > Router::connect('/intranet/', array('controller' => 'users', 'action'
> > > => 'index', 'prefix' => 'intranet', 'intranet' => true));
> > > Router::connect('/intranet/:controller/:action/*', array('prefix' =>
> > > 'intranet', 'intranet' => true));
> >
> > > Works fine, except for creating a link with a named parameter:
> >
> > > $html->link('alle Termine', array('controller' => $params
> > > ['controller'], 'action' => 'entries', 'intranet'=>true, 'future' =>
> > > '0'));
> >
> > > creates this link:
> >
> > > /calendar_entries/entries/intranet:1/future:1
> >
> > > instead of:
> >
> > > /intranet/calendar_entries/entries/future:1
> >
> > > Anything new about this problem here?
> >
> > > TIA, Phil
> >
> > > Marcelius schrieb:
> > >> I'm usually not the guy who bumbs postings but this problem still
> > >> exists... So my question is: is this behavior by design or am I doing
> > >> something wrong?
> >
> > >> On 12 dec, 07:53, Marcelius  wrote:
> > >> > Thanks for the anwser but that didn't work here.
> >
> > >> > The be more clear: If I do not usenamedparams, the the url is
> > >> > correct: It has the prefix /owner
> > >> > If I do usenamedparams, the router adds owner:1 as anamedparam
> > >> > instead of prepending the /owner prefix.
> >
> > >> > So:
> > >> > Router::url(array("controller"=>"invoices", "action"=>"edit", 5,
> > >> > "owner"=>true, "key"=>"val"));
> >
> > >> > Returns and not expected:
> > >> > "/invoices/edit/5/owner:1/key:val"
> > >> > I would expect:
> > >> > "/owner/invoices/edit/5/key:val"
> >
> > >> > On 11 dec, 16:31, Lane  wrote:
> >
> > >> > > What were you expecting the Router to return if not
> "/invoices/edit/5/
> > >> > > owner:1/key:val"?
> >
> > >> > > On Dec 11, 4:39 am, Marcelius  wrote:
> >
> > >> > > > Hello!
> >
> > >> > > > I have this route like the manual says for prefix routing:
> >
> > >> > > > Router::connect('/owner/:controller/:action/*', array
> > >> > > > ('prefix'=>'owner', 'owner'=>true));
> >
> > >> > > > This works fine until I want to create a url with
> somenamedparamsin
> > >> > > > it:
> >
> > >> > > > Router::url(array("controller"=>"invoices", "action"=>"edit", 5,
> > >> > > > "owner"=>true));
> > >> > > > returns "/owner/invoices/edit/5" as expected.
> >
> > >> > > > Router::url(array("controller"=>"invoices", "action"=>"edit", 5,
> > >> > > > "owner"=>true, "key"=>"val"));
> > >> > > > returns "/invoices/edit/5/owner:1/key:val" not as expected.
> >
> > >> > > > Something wrong in my routes? Please note that that's the only
> route
> > >> > > > available.
> >
> > >> > > > Thanks in advance!
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: named params and prefix routing

2009-01-07 Thread Phil

Thanks for your idea - I just tried it, but interestingly, it doesn't
work (i.e. the prefix is not set), but there's also no named parameter
"prefix" appended to the url - it's completely ignored, as it seems.

On 7 Jan., 18:55, brian  wrote:
> I've not used prefix routing myself but have you tried setting
> 'prefix' in the link method?
>
> $html->link('alle Termine', array('controller' => $params
> ['controller'], 'action' => 'entries', 'prefix' => 'intranet', 'future' =>
> '0'));
>
> On Wed, Jan 7, 2009 at 7:35 AM, Phil  wrote:
>
> > Same problem here - these are my routes:
>
> > Router::connect('/intranet/', array('controller' => 'users', 'action'
> > => 'index', 'prefix' => 'intranet', 'intranet' => true));
> > Router::connect('/intranet/:controller/:action/*', array('prefix' =>
> > 'intranet', 'intranet' => true));
>
> > Works fine, except for creating a link with a named parameter:
>
> > $html->link('alle Termine', array('controller' => $params
> > ['controller'], 'action' => 'entries', 'intranet'=>true, 'future' =>
> > '0'));
>
> > creates this link:
>
> > /calendar_entries/entries/intranet:1/future:1
>
> > instead of:
>
> > /intranet/calendar_entries/entries/future:1
>
> > Anything new about this problem here?
>
> > TIA, Phil
>
> > Marcelius schrieb:
> >> I'm usually not the guy who bumbs postings but this problem still
> >> exists... So my question is: is this behavior by design or am I doing
> >> something wrong?
>
> >> On 12 dec, 07:53, Marcelius  wrote:
> >> > Thanks for the anwser but that didn't work here.
>
> >> > The be more clear: If I do not usenamedparams, the the url is
> >> > correct: It has the prefix /owner
> >> > If I do usenamedparams, the router adds owner:1 as anamedparam
> >> > instead of prepending the /owner prefix.
>
> >> > So:
> >> > Router::url(array("controller"=>"invoices", "action"=>"edit", 5,
> >> > "owner"=>true, "key"=>"val"));
>
> >> > Returns and not expected:
> >> > "/invoices/edit/5/owner:1/key:val"
> >> > I would expect:
> >> > "/owner/invoices/edit/5/key:val"
>
> >> > On 11 dec, 16:31, Lane  wrote:
>
> >> > > What were you expecting the Router to return if not "/invoices/edit/5/
> >> > > owner:1/key:val"?
>
> >> > > On Dec 11, 4:39 am, Marcelius  wrote:
>
> >> > > > Hello!
>
> >> > > > I have this route like the manual says for prefix routing:
>
> >> > > > Router::connect('/owner/:controller/:action/*', array
> >> > > > ('prefix'=>'owner', 'owner'=>true));
>
> >> > > > This works fine until I want to create a url with somenamedparamsin
> >> > > > it:
>
> >> > > > Router::url(array("controller"=>"invoices", "action"=>"edit", 5,
> >> > > > "owner"=>true));
> >> > > > returns "/owner/invoices/edit/5" as expected.
>
> >> > > > Router::url(array("controller"=>"invoices", "action"=>"edit", 5,
> >> > > > "owner"=>true, "key"=>"val"));
> >> > > > returns "/invoices/edit/5/owner:1/key:val" not as expected.
>
> >> > > > Something wrong in my routes? Please note that that's the only route
> >> > > > available.
>
> >> > > > Thanks in advance!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: named params and prefix routing

2009-01-07 Thread brian
I've not used prefix routing myself but have you tried setting
'prefix' in the link method?

$html->link('alle Termine', array('controller' => $params
['controller'], 'action' => 'entries', 'prefix' => 'intranet', 'future' =>
'0'));


On Wed, Jan 7, 2009 at 7:35 AM, Phil  wrote:
>
> Same problem here - these are my routes:
>
> Router::connect('/intranet/', array('controller' => 'users', 'action'
> => 'index', 'prefix' => 'intranet', 'intranet' => true));
> Router::connect('/intranet/:controller/:action/*', array('prefix' =>
> 'intranet', 'intranet' => true));
>
> Works fine, except for creating a link with a named parameter:
>
> $html->link('alle Termine', array('controller' => $params
> ['controller'], 'action' => 'entries', 'intranet'=>true, 'future' =>
> '0'));
>
> creates this link:
>
> /calendar_entries/entries/intranet:1/future:1
>
> instead of:
>
> /intranet/calendar_entries/entries/future:1
>
> Anything new about this problem here?
>
> TIA, Phil
>
> Marcelius schrieb:
>> I'm usually not the guy who bumbs postings but this problem still
>> exists... So my question is: is this behavior by design or am I doing
>> something wrong?
>>
>> On 12 dec, 07:53, Marcelius  wrote:
>> > Thanks for the anwser but that didn't work here.
>> >
>> > The be more clear: If I do not usenamedparams, the the url is
>> > correct: It has the prefix /owner
>> > If I do usenamedparams, the router adds owner:1 as anamedparam
>> > instead of prepending the /owner prefix.
>> >
>> > So:
>> > Router::url(array("controller"=>"invoices", "action"=>"edit", 5,
>> > "owner"=>true, "key"=>"val"));
>> >
>> > Returns and not expected:
>> > "/invoices/edit/5/owner:1/key:val"
>> > I would expect:
>> > "/owner/invoices/edit/5/key:val"
>> >
>> > On 11 dec, 16:31, Lane  wrote:
>> >
>> > > What were you expecting the Router to return if not "/invoices/edit/5/
>> > > owner:1/key:val"?
>> >
>> > > On Dec 11, 4:39�am, Marcelius  wrote:
>> >
>> > > > Hello!
>> >
>> > > > I have this route like the manual says for prefix routing:
>> >
>> > > > Router::connect('/owner/:controller/:action/*', array
>> > > > ('prefix'=>'owner', 'owner'=>true));
>> >
>> > > > This works fine until I want to create a url with somenamedparamsin
>> > > > it:
>> >
>> > > > Router::url(array("controller"=>"invoices", "action"=>"edit", 5,
>> > > > "owner"=>true));
>> > > > returns "/owner/invoices/edit/5" as expected.
>> >
>> > > > Router::url(array("controller"=>"invoices", "action"=>"edit", 5,
>> > > > "owner"=>true, "key"=>"val"));
>> > > > returns "/invoices/edit/5/owner:1/key:val" not as expected.
>> >
>> > > > Something wrong in my routes? Please note that that's the only route
>> > > > available.
>> >
>> > > > Thanks in advance!
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: named params and prefix routing

2009-01-07 Thread Phil

Same problem here - these are my routes:

Router::connect('/intranet/', array('controller' => 'users', 'action'
=> 'index', 'prefix' => 'intranet', 'intranet' => true));
Router::connect('/intranet/:controller/:action/*', array('prefix' =>
'intranet', 'intranet' => true));

Works fine, except for creating a link with a named parameter:

$html->link('alle Termine', array('controller' => $params
['controller'], 'action' => 'entries', 'intranet'=>true, 'future' =>
'0'));

creates this link:

/calendar_entries/entries/intranet:1/future:1

instead of:

/intranet/calendar_entries/entries/future:1

Anything new about this problem here?

TIA, Phil

Marcelius schrieb:
> I'm usually not the guy who bumbs postings but this problem still
> exists... So my question is: is this behavior by design or am I doing
> something wrong?
>
> On 12 dec, 07:53, Marcelius  wrote:
> > Thanks for the anwser but that didn't work here.
> >
> > The be more clear: If I do not usenamedparams, the the url is
> > correct: It has the prefix /owner
> > If I do usenamedparams, the router adds owner:1 as anamedparam
> > instead of prepending the /owner prefix.
> >
> > So:
> > Router::url(array("controller"=>"invoices", "action"=>"edit", 5,
> > "owner"=>true, "key"=>"val"));
> >
> > Returns and not expected:
> > "/invoices/edit/5/owner:1/key:val"
> > I would expect:
> > "/owner/invoices/edit/5/key:val"
> >
> > On 11 dec, 16:31, Lane  wrote:
> >
> > > What were you expecting the Router to return if not "/invoices/edit/5/
> > > owner:1/key:val"?
> >
> > > On Dec 11, 4:39�am, Marcelius  wrote:
> >
> > > > Hello!
> >
> > > > I have this route like the manual says for prefix routing:
> >
> > > > Router::connect('/owner/:controller/:action/*', array
> > > > ('prefix'=>'owner', 'owner'=>true));
> >
> > > > This works fine until I want to create a url with somenamedparamsin
> > > > it:
> >
> > > > Router::url(array("controller"=>"invoices", "action"=>"edit", 5,
> > > > "owner"=>true));
> > > > returns "/owner/invoices/edit/5" as expected.
> >
> > > > Router::url(array("controller"=>"invoices", "action"=>"edit", 5,
> > > > "owner"=>true, "key"=>"val"));
> > > > returns "/invoices/edit/5/owner:1/key:val" not as expected.
> >
> > > > Something wrong in my routes? Please note that that's the only route
> > > > available.
> >
> > > > Thanks in advance!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: named params and prefix routing

2008-12-16 Thread Marcelius

I'm usually not the guy who bumbs postings but this problem still
exists... So my question is: is this behavior by design or am I doing
something wrong?

On 12 dec, 07:53, Marcelius  wrote:
> Thanks for the anwser but that didn't work here.
>
> The be more clear: If I do not usenamedparams, the the url is
> correct: It has the prefix /owner
> If I do usenamedparams, the router adds owner:1 as anamedparam
> instead of prepending the /owner prefix.
>
> So:
> Router::url(array("controller"=>"invoices", "action"=>"edit", 5,
> "owner"=>true, "key"=>"val"));
>
> Returns and not expected:
> "/invoices/edit/5/owner:1/key:val"
> I would expect:
> "/owner/invoices/edit/5/key:val"
>
> On 11 dec, 16:31, Lane  wrote:
>
> > What were you expecting the Router to return if not "/invoices/edit/5/
> > owner:1/key:val"?
>
> > On Dec 11, 4:39 am, Marcelius  wrote:
>
> > > Hello!
>
> > > I have this route like the manual says for prefix routing:
>
> > > Router::connect('/owner/:controller/:action/*', array
> > > ('prefix'=>'owner', 'owner'=>true));
>
> > > This works fine until I want to create a url with somenamedparamsin
> > > it:
>
> > > Router::url(array("controller"=>"invoices", "action"=>"edit", 5,
> > > "owner"=>true));
> > > returns "/owner/invoices/edit/5" as expected.
>
> > > Router::url(array("controller"=>"invoices", "action"=>"edit", 5,
> > > "owner"=>true, "key"=>"val"));
> > > returns "/invoices/edit/5/owner:1/key:val" not as expected.
>
> > > Something wrong in my routes? Please note that that's the only route
> > > available.
>
> > > Thanks in advance!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: named params and prefix routing

2008-12-11 Thread Marcelius

Thanks for the anwser but that didn't work here.

The be more clear: If I do not use named params, the the url is
correct: It has the prefix /owner
If I do use named params, the router adds owner:1 as a named param
instead of prepending the /owner prefix.

So:
Router::url(array("controller"=>"invoices", "action"=>"edit", 5,
"owner"=>true, "key"=>"val"));

Returns and not expected:
"/invoices/edit/5/owner:1/key:val"
I would expect:
"/owner/invoices/edit/5/key:val"

On 11 dec, 16:31, Lane  wrote:
> What were you expecting the Router to return if not "/invoices/edit/5/
> owner:1/key:val"?
>
> On Dec 11, 4:39 am, Marcelius  wrote:
>
> > Hello!
>
> > I have this route like the manual says for prefix routing:
>
> > Router::connect('/owner/:controller/:action/*', array
> > ('prefix'=>'owner', 'owner'=>true));
>
> > This works fine until I want to create a url with some named params in
> > it:
>
> > Router::url(array("controller"=>"invoices", "action"=>"edit", 5,
> > "owner"=>true));
> > returns "/owner/invoices/edit/5" as expected.
>
> > Router::url(array("controller"=>"invoices", "action"=>"edit", 5,
> > "owner"=>true, "key"=>"val"));
> > returns "/invoices/edit/5/owner:1/key:val" not as expected.
>
> > Something wrong in my routes? Please note that that's the only route
> > available.
>
> > Thanks in advance!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: named params and prefix routing

2008-12-11 Thread Andras Kende
Hello,

I had some issue with multiple admin routes, links or paginator links were
incorrect or mixed up ...
this routes works for me now without :

routes.php
"page",
"prefix"=>$area, "action"=>"index", $area));
Router::connect("/".$area."/:controller/:action", array("prefix"=>$area,
"".$area.""=>true));
Router::connect("/".$area."/:controller/:action/*",
array("prefix"=>$area, "".$area.""=>true));
Router::connect("/".$area."/:controller/:action/*",
array("prefix"=>$area));
}
?>


Andras Kende

On Thu, Dec 11, 2008 at 6:39 AM, Marcelius <[EMAIL PROTECTED]> wrote:

>
> Hello!
>
> I have this route like the manual says for prefix routing:
>
> Router::connect('/owner/:controller/:action/*', array
> ('prefix'=>'owner', 'owner'=>true));
>
> This works fine until I want to create a url with some named params in
> it:
>
> Router::url(array("controller"=>"invoices", "action"=>"edit", 5,
> "owner"=>true));
> returns "/owner/invoices/edit/5" as expected.
>
> Router::url(array("controller"=>"invoices", "action"=>"edit", 5,
> "owner"=>true, "key"=>"val"));
> returns "/invoices/edit/5/owner:1/key:val" not as expected.
>
> Something wrong in my routes? Please note that that's the only route
> available.
>
> Thanks in advance!
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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: named params and prefix routing

2008-12-11 Thread Lane

What were you expecting the Router to return if not "/invoices/edit/5/
owner:1/key:val"?

On Dec 11, 4:39 am, Marcelius <[EMAIL PROTECTED]> wrote:
> Hello!
>
> I have this route like the manual says for prefix routing:
>
> Router::connect('/owner/:controller/:action/*', array
> ('prefix'=>'owner', 'owner'=>true));
>
> This works fine until I want to create a url with some named params in
> it:
>
> Router::url(array("controller"=>"invoices", "action"=>"edit", 5,
> "owner"=>true));
> returns "/owner/invoices/edit/5" as expected.
>
> Router::url(array("controller"=>"invoices", "action"=>"edit", 5,
> "owner"=>true, "key"=>"val"));
> returns "/invoices/edit/5/owner:1/key:val" not as expected.
>
> Something wrong in my routes? Please note that that's the only route
> available.
>
> Thanks in advance!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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
-~--~~~~--~~--~--~---