Dear All,

I've an issue with custom routing and automagic paginator links...

Here are the patterns I would like for my uris:

http://www.mywebsite.com/petites-annonces/belles-annonces/prix
http://www.mywebsite.com/petites-annonces/belles-annonces/date
http://www.mywebsite.com/petites-annonces/belles-annonces/taille
http://www.mywebsite.com/petites-annonces/professionnels/taille
http://www.mywebsite.com/petites-annonces/professionnels/prix

where "http://www.mywebsite.com/petites-annonces"; is my base uri.

So I've written this route:

Router::connect ('/petites-annonces/:category/:toto',
array
(
'controller'=>'annonces',
'action'=>'listing'
),
array
(
'category' => "professionnels|belles-annonces|particuliers",
'toto' => "date|vue|modele|prix|taille|localisation|rubrique|chantier"
));

And this is my "listing" action in AnnoncesController:

public function listing() {
  $this->Annonce->contain(false,array('PhotoAnnonce(url)'));
  $this->paginate = array
  (
        'limit'  => 25,
        'order' => 'name ASC',
        'conditions' => $conditions,
        'fields'  => array('id', 'name', 'year', 'price')
  );
  $this->set('annonces',$this->paginate('Annonce'));
  $this->render('listing','annonces_listing','search_model');
}

Finally, here are 3 ways I've tested to implement my paginator links
in 'views/annonces/search_model.ctp':

<ul>
<li class="first-page"><?php echo $paginator->first('première
page',array('url'=>$this->params['url']['url'])); ?></li>
<li><?php echo $paginator->numbers(array('separator'=>'
','modulus'=>10,'url'=>$this->params['category']));?></li>
<li class="last-page"><?php echo $paginator->last('dernière
page',array('url'=>array($this->params['category'],$this-
>params['toto']));?></li>
</ul>

How can I keep this pattern in the paginator links (prev, first,
numbers)?
Because all my tests have failed: the paginator links always contain
"http://www.mywebsite.com/annonces/listing/"; instead of "http://
www.mywebsite.com/petites-annonces"

Thank's for all suggestions...

Cheers
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to