Re: Routing with Query Strings

2011-05-30 Thread Rjs37
And an extra question continuing from the above post concerning pagination
and it's urls. 

Currently using the url format mentioned in my above post it's coming up
with:
ps3/blackops/ladders/clan/view/page:1/sort:rank/direction:asc?season=3

where as I'd prefer the paginator to use the query string rather than named
parameters. Those named parameters look horrible. Is there a way to get it
to do this? i.e I'd prefer the below:
/ps3/blackops/ladders/clan?season=3&page=1&sort=rank&direction=asc

Alternatively if I could get rid of the 'page:' stuff it would probably
suffice too. Something like:
/ps3/blackops/ladders/clan/3/1/rank/asc 
though I imagine it wouldn't like me not having the action in the url and
it's not very user friendly in the sense they wouldn't know how the numbers
correlate.

--
View this message in context: 
http://cakephp.1045679.n5.nabble.com/Routing-with-Query-Strings-tp4433697p4435721.html
Sent from the CakePHP mailing list archive at Nabble.com.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Routing with Query Strings

2011-05-28 Thread Rjs37
The problem I'm having is that when I use the html helper to define a link
and add a query string it puts the action back into the url when I don't
want it there (second route).

I've got the following routes defined for the site I'm coding:

 $consoles = 'ps3|360';
Router::connect('/:console/:arena/:controller/:slug/:action/*', array(),
array('console' => $consoles));
Router::connect('/:console/:arena/:controller/:slug/*', 
array('action' => 'view', 'slug' => null),
array('console' => $consoles));
Router::connect('/:console/:arena/:controller/*', 
array('action' => 'arena'),
array('console' => $consoles));
Router::connect('/:console/:arena/*', 
array('controller' => 'arenas'),
array('console' => $consoles));

So an example of the more complex urls we'd have would be:

/ps3/blackops/ladders/doubles/join
/ps3/blackops/ladders/doubles - would use view action

I was defining the links manually but I'm making the switch to using the
html helper for links instead. 

When the view action is being used I was looking to add some extra variables
to the end using the query string (as I don't really want view in the url -
plus I have a few variables). So I was hoping for something like this: 
/ps3/blackops/ladders/clan?season=3&sort=wins&ord=asc (last couple would be
used for pagination)

but when I do this:

echo $html->link('Testing', array(
'console' => 'ps3',
'arena' => 'blackops',
'controller' => 'ladders',
'action' => 'view',
'slug' => 'clan',
    '?' => array('season' => '3')
));

I'm getting: /ps3/blackops/ladders/clan/view?season=3

Is there a way of stopping the view from appearing automatically? If I don't
have the query string then it generates the urls how I expect. 

Thanks in advance for any help provided.

--
View this message in context: 
http://cakephp.1045679.n5.nabble.com/Routing-with-Query-Strings-tp4433697p4433697.html
Sent from the CakePHP mailing list archive at Nabble.com.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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