Hello,

I have a controller: "domains" and action "search_domain", I would
like to get an URL for example: myApp/search/keyword

I am trying to achieve that with Routing, however with no success.

I tried many variations of that, now here is the latest one I have:

        Router::connect('/search/:keyword/*',
                                        array('controller' => 'domains', 
'action' => 'search_domain'),
                                        array('pass' => array('keyword'), 
'keyword' => '[a-zA-Z0-9\-]
+'));

Anyway it would be better if I could get named params, so then I can
check on them.

I have something like this in my controller:

                if(!empty($this->params['named']['keyword']) || 
$this->passedArgs
[0]) {

                        $keyword = isset($this->params['named']['keyword']) ? 
$this->params
['named']['keyword'] : $this->passedArgs[0];

However on pagination I am getting links like:
myApp/domains/search_domain/thisiskeyword/page:2

instead of myApp/search/thisiskeyword/page:2

Any ideas how to solve that?

Thank you,
Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
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

Reply via email to