Hello,

I have inherited a big application based on cake 1.2. The search works via named parameters in the URL because the search form is placed in the layout header *ouch* and works for more than one model.

So the search parameter is passed like http://www.mynicedomain.de/gruppen/suche:Köln

this is passed through a huge routes.php file:

  // Group Overview (with searchword)
  Router::connect(
    '/gruppen/suche::search',
    array(
      'controller' => 'groups',
      'action' => 'index'
    ),
    array(
      'search' => '[^/?&:]+'
    )
  );

Since it is a German page with all those nasty umlauts I already intervene via JavaScript in the search form and encode "Köln" to "K%C3%B6ln" which I successfully catch in the controller via

                $suche = explode(':',$_SERVER['REQUEST_URI']);
                if(isset($suche[1]) && isset($this->params['search'])){
                        $suchbegriffe = explode(':',$suche[1]);
                        $suchbegriff = explode('/',$suchbegriffe[0]);
                        $search = urldecode($suchbegriff[0]);
                }
So now "K%C3%B6ln" is back to "Köln". and my search works just fine until I get more than one page of results. And woe is me!

What I try now is
in the controller:
$urlsearch = urlencode(trim($search));
                $urloption =                    array(
                                'controller' => 'groups',
                                'action' => $this->action,
                                'suche:'.$urlsearch,
                        );
                $paginator_params = array(
                        'pass' => $urloption,
                );
and in the view (in an element):

$paginator->options(array(
'url' => $paginator->params['paging'][$model]['options']['url']['pass']));

latter containing my array:
url array(
    controller => groups
    action => index
    0 => suche:K%C3%B6ln
)

But the url of the paging numbers still results in
/gruppen/suche:Köln/seite:2
Köln again with "ö" causing my paging to break.

Where have I missed to pass on my encoded parameters?

Thanks for any advice

Anja




--
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
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

<<attachment: anja_liebermann.vcf>>

Reply via email to