Re: Search keyword in url params

2009-08-20 Thread Jecki

Hi,

CMIIW, but I think you won't be able to achieve that without one of:
1. redirection (as mentioned by others)
2. javascript on form's submit event handler

The default behavior of the browser is to append the input as
querystring behind the requested URL.

On Thu, Aug 20, 2009 at 9:47 PM, kicaj wrote:
>
> How add to url search keyword?
> I want like this url: /products/search/keyword from simple form with
> one text input field?
>
> Sorry, maybe it's stupid question...

--~--~-~--~~~---~--~~
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: Search keyword in url params

2009-08-20 Thread majna

Then write apache rewrite rules in htaccess...

On Aug 20, 9:42 pm, kicaj  wrote:
> Thank for answer, but redirect it's not fine, I think that...
> But when I use GET method, i get url like this: /products/search?
> field_name=keyword,
> This not the same like: /products/search/keyword
>
> On Aug 20, 9:36 pm, majna  wrote:
>
> > You can use redirection:
>
> > public function search($keyword=null){
> >    if (isset($this->params['form']['search'] && !empty($this->params
> > ['form']['search'])){
> >        $this->redirect('/products/search/'. $this->params['form']
> > ['search']);
> >     }
>
> > }
>
> > or use http get:http://book.cakephp.org/view/184/options-type
>
> > On Aug 20, 3:47 pm, kicaj  wrote:
>
> > > How add to url search keyword?
> > > I want like this url: /products/search/keyword from simple form with
> > > one text input field?
>
> > > Sorry, maybe it's stupid question...
>
>
--~--~-~--~~~---~--~~
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: Search keyword in url params

2009-08-20 Thread kicaj

Thank for answer, but redirect it's not fine, I think that...
But when I use GET method, i get url like this: /products/search?
field_name=keyword,
This not the same like: /products/search/keyword


On Aug 20, 9:36 pm, majna  wrote:
> You can use redirection:
>
> public function search($keyword=null){
>    if (isset($this->params['form']['search'] && !empty($this->params
> ['form']['search'])){
>        $this->redirect('/products/search/'. $this->params['form']
> ['search']);
>     }
>
> }
>
> or use http get:http://book.cakephp.org/view/184/options-type
>
> On Aug 20, 3:47 pm, kicaj  wrote:
>
> > How add to url search keyword?
> > I want like this url: /products/search/keyword from simple form with
> > one text input field?
>
> > Sorry, maybe it's stupid question...
--~--~-~--~~~---~--~~
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: Search keyword in url params

2009-08-20 Thread majna

You can use redirection:

public function search($keyword=null){
   if (isset($this->params['form']['search'] && !empty($this->params
['form']['search'])){
   $this->redirect('/products/search/'. $this->params['form']
['search']);
}
}

or use http get:
http://book.cakephp.org/view/184/options-type


On Aug 20, 3:47 pm, kicaj  wrote:
> How add to url search keyword?
> I want like this url: /products/search/keyword from simple form with
> one text input field?
>
> Sorry, maybe it's stupid question...
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Search keyword in url params

2009-08-20 Thread kicaj

How add to url search keyword?
I want like this url: /products/search/keyword from simple form with
one text input field?

Sorry, maybe it's stupid question...
--~--~-~--~~~---~--~~
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: % in url params

2008-12-19 Thread fito

@Bernardo That's a good practise. I'll try it from now on.
@brian It could be the problem. I did try the same url in two servers.
In the first one all was ok, but in the second one I'd got the
problem, probably the two servers have different configuration.

Thank you very much guys.
--~--~-~--~~~---~--~~
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: % in url params

2008-12-18 Thread brian

On Thu, Dec 18, 2008 at 4:45 AM, fito  wrote:
>
> Hi friends.
>
> I've been using cake for some months, but it was today the first time
> I tried to invoke a controller method with a % character in the url.
> Something like this:
>
> $html->link('Example', '/controller/method?width=90%')
>

A server will expect that the % is a prelude to a hex character. Not a
good idea to use that in a URL for anything else.

http://www.faqs.org/rfcs/rfc1738.html

--~--~-~--~~~---~--~~
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: % in url params

2008-12-18 Thread Bernardo Vieira

You shoul urlencode('90%') I suppose. Anyway, wouldn't it be better to  
use named parameters? That way you get cake's pretty urls and the html 
helper does the urlencoding as necessary for you.

fito wrote:
> Hi friends.
>
> I've been using cake for some months, but it was today the first time
> I tried to invoke a controller method with a % character in the url.
> Something like this:
>
> $html->link('Example', '/controller/method?width=90%')
>
> The link was well-formed but response from the server was something
> like
>
> "Not Acceptable. The page you've requested doesn't exists... "
>
> does anyone know why?
>
> >
>
>   


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



% in url params

2008-12-18 Thread fito

Hi friends.

I've been using cake for some months, but it was today the first time
I tried to invoke a controller method with a % character in the url.
Something like this:

$html->link('Example', '/controller/method?width=90%')

The link was well-formed but response from the server was something
like

"Not Acceptable. The page you've requested doesn't exists... "

does anyone know why?

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