Thank you for your response Sam,...
In fact I did that,... another version to attempt... but now I'm not
getting search results, but the page is clean on URL bar,... and yes
its a urlencoded space %20

here is what I have...


   function search($name = null)
  {
    if(!empty($this->data))
    {
        $url = '/groups/search/';

      if(!empty($this->data['Group']['name']))
      {
        $url .= str_replace(' ', '+', $this->data['Group']['name']);
        unset($this->data['Group']['name']);
      }

      $this->redirect($url);
    }
    else
    {

        $filter = $this->params['pass'];
        unset($filter['page']);
        unset($filter['sort']);
        unset($filter['direction']);
        $this->data = array('Group' => $filter);
        $this->set('url_options', $filter);

      $this->data = array('Group' => array('name' => str_replace('+',
' ', $name)));

      // $this->set_title(ucfirst(i18n::translate('search Groups')));
      $this-
>set_title(ucfirst(Inflector::pluralize(i18n::translate('group'))) .
' : ' . str_replace('+', ' ', $name));


        $scope = array('Group.name IS NOT NULL');

        foreach(array('name') as $field)
        {
          if(!empty($filter[$field]))
            $scope[] = 'Group.' . $field . ' LIKE \'%' .
$filter[$field] . '%\'';
        }

        if($this->is_user())
          $this->set('friends_ids', $this->Friend->myFriends($this-
>user['id']));
        else
          $this->set('friends_ids', array());

        if(empty($filter['name']))
          $this->set('groups', $this->paginate('Group', '1 = 0'));
        else
          $this->set('groups', $this->paginate('Group', $scope));

    }
  }



On Mar 10, 7:27 am, Sam Bernard <[email protected]> wrote:
> What error are you getting? %20 is just a urlencoded space... it isn't an
> error.
>
> If you want to replace it with a space then just do your str_replace on your
> $url var right before "$this->redirect($url);".

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

Reply via email to