Re: Still no answer on how to do this...

2009-10-15 Thread robustsolution

Dear Kyte

sorry for the delay, I forgot!

Solution

just add this code in the beginning of the app\config\routes.php file
$singleton_router =& Router::getInstance();
if(!in_array('q',$singleton_router->named['default']))
$singleton_router->named['default'][]='q';

the problem is that the default named parameters in CakePHP routing
are
'page', 'fields', 'order', 'limit', 'recursive', 'sort', 'direction',
'step'

that's why we need to add this 'q' named parameter otherwise cakePHP
will not detect the route you have defined

have a nice baking day

On Oct 11, 12:34 am, Kyle Decot  wrote:
> I'm using $html->link() not $html->url(); I don't know why I typed
> that.
>
> I don't know what you mean by the first part of your response
>
> On Oct 10, 5:29 pm, robust solution  wrote:
>
>
>
> > Dear Kyle Decot
>
> > I think whenever you define a route in the routes.php you should not
> > repeat the route parameters in every url you want to show... the
> > shortcut is enough
>
> > this is first...
>
> > secondly
>
> > ->url is for url
>
> > for hyperlink use ->link
>
> > On Oct 10, 11:21 pm, Kyle Decot  wrote:
>
> > > Can someone please help me with this? I've tried posting on here and
> > > on the IRC channel and no one can seem to figure this out...it this
> > > just not possible with cake? All I am trying to do is creating a link
> > > using reverse routing and having named params in the URL.
>
> > > On Oct 9, 10:38 pm, Kyle Decot  wrote:
>
> > > > I want to set up my website so I can have urls like:
>
> > > > sample.com/search/
> > > > sample.com/search/q:search+terms/
> > > > sample.com/search/country:us/region:oh/
> > > > ..etc..
>
> > > > I also want to be able to do reverse routing w/ my links. I have my
> > > > routes.php set up like:
>
> > > > Router::connect('/search/*', array('controller' => 'model', 'action'
> > > > => 'index'));
>
> > > > and then I print a link like:
>
> > > > echo $html->url("search",array
> > > > ("controller"=>"model","action"=>"index","q"=>"search terms go
> > > > here"));
>
> > > > but the link comes out as:
>
> > > > /model/index/q:search/
>
> > > > What am I doing wrong? I have tried to get an answer to this question
> > > > before but nobody can seem to tell me the correct way of doing this.
> > > > Any help you can give me is EXTREMELY appreciated!- Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
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: Still no answer on how to do this...

2009-10-10 Thread Kyle Decot

I'm using $html->link() not $html->url(); I don't know why I typed
that.

I don't know what you mean by the first part of your response

On Oct 10, 5:29 pm, robust solution  wrote:
> Dear Kyle Decot
>
> I think whenever you define a route in the routes.php you should not
> repeat the route parameters in every url you want to show... the
> shortcut is enough
>
> this is first...
>
> secondly
>
> ->url is for url
>
> for hyperlink use ->link
>
> On Oct 10, 11:21 pm, Kyle Decot  wrote:
>
>
>
> > Can someone please help me with this? I've tried posting on here and
> > on the IRC channel and no one can seem to figure this out...it this
> > just not possible with cake? All I am trying to do is creating a link
> > using reverse routing and having named params in the URL.
>
> > On Oct 9, 10:38 pm, Kyle Decot  wrote:
>
> > > I want to set up my website so I can have urls like:
>
> > > sample.com/search/
> > > sample.com/search/q:search+terms/
> > > sample.com/search/country:us/region:oh/
> > > ..etc..
>
> > > I also want to be able to do reverse routing w/ my links. I have my
> > > routes.php set up like:
>
> > > Router::connect('/search/*', array('controller' => 'model', 'action'
> > > => 'index'));
>
> > > and then I print a link like:
>
> > > echo $html->url("search",array
> > > ("controller"=>"model","action"=>"index","q"=>"search terms go
> > > here"));
>
> > > but the link comes out as:
>
> > > /model/index/q:search/
>
> > > What am I doing wrong? I have tried to get an answer to this question
> > > before but nobody can seem to tell me the correct way of doing this.
> > > Any help you can give me is EXTREMELY appreciated!- Hide quoted text -
>
> > - Show quoted text -
--~--~-~--~~~---~--~~
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: Still no answer on how to do this...

2009-10-10 Thread robust solution

Dear Kyle Decot

I think whenever you define a route in the routes.php you should not
repeat the route parameters in every url you want to show... the
shortcut is enough

this is first...

secondly

->url is for url

for hyperlink use ->link




On Oct 10, 11:21 pm, Kyle Decot  wrote:
> Can someone please help me with this? I've tried posting on here and
> on the IRC channel and no one can seem to figure this out...it this
> just not possible with cake? All I am trying to do is creating a link
> using reverse routing and having named params in the URL.
>
> On Oct 9, 10:38 pm, Kyle Decot  wrote:
>
>
>
> > I want to set up my website so I can have urls like:
>
> > sample.com/search/
> > sample.com/search/q:search+terms/
> > sample.com/search/country:us/region:oh/
> > ..etc..
>
> > I also want to be able to do reverse routing w/ my links. I have my
> > routes.php set up like:
>
> > Router::connect('/search/*', array('controller' => 'model', 'action'
> > => 'index'));
>
> > and then I print a link like:
>
> > echo $html->url("search",array
> > ("controller"=>"model","action"=>"index","q"=>"search terms go
> > here"));
>
> > but the link comes out as:
>
> > /model/index/q:search/
>
> > What am I doing wrong? I have tried to get an answer to this question
> > before but nobody can seem to tell me the correct way of doing this.
> > Any help you can give me is EXTREMELY appreciated!- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
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: Still no answer on how to do this...

2009-10-10 Thread Kyle Decot

Can someone please help me with this? I've tried posting on here and
on the IRC channel and no one can seem to figure this out...it this
just not possible with cake? All I am trying to do is creating a link
using reverse routing and having named params in the URL.

On Oct 9, 10:38 pm, Kyle Decot  wrote:
> I want to set up my website so I can have urls like:
>
> sample.com/search/
> sample.com/search/q:search+terms/
> sample.com/search/country:us/region:oh/
> ..etc..
>
> I also want to be able to do reverse routing w/ my links. I have my
> routes.php set up like:
>
> Router::connect('/search/*', array('controller' => 'model', 'action'
> => 'index'));
>
> and then I print a link like:
>
> echo $html->url("search",array
> ("controller"=>"model","action"=>"index","q"=>"search terms go
> here"));
>
> but the link comes out as:
>
> /model/index/q:search/
>
> What am I doing wrong? I have tried to get an answer to this question
> before but nobody can seem to tell me the correct way of doing this.
> Any help you can give me is EXTREMELY appreciated!
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Still no answer on how to do this...

2009-10-09 Thread Kyle Decot

I want to set up my website so I can have urls like:

sample.com/search/
sample.com/search/q:search+terms/
sample.com/search/country:us/region:oh/
..etc..

I also want to be able to do reverse routing w/ my links. I have my
routes.php set up like:

Router::connect('/search/*', array('controller' => 'model', 'action'
=> 'index'));

and then I print a link like:

echo $html->url("search",array
("controller"=>"model","action"=>"index","q"=>"search terms go
here"));

but the link comes out as:

/model/index/q:search/

What am I doing wrong? I have tried to get an answer to this question
before but nobody can seem to tell me the correct way of doing this.
Any help you can give me is EXTREMELY appreciated!

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