Naturally I would use option #1, but I my form has a dozen or so
fields, potentially increasing. Maybe it is just me, but I think that
would make things kind of complicated.
Anyways, I went with option one. This is what I did:
function index($conditions=NULL) {
if ((!isset($conditions)) OR ($conditions==NULL)){
$conditions = $mycustomquery;
} else {
$conditions = base64_decode($conditions);
}
$fields = array('*');
$options = Array ("url"=>"index/".base64_encode($conditions));
list($order,$limit,$page) =
$this->Pagination->init($conditions,NULL,$options);
$this->set('mlslistings', $this->Mlslisting->findAll($conditions,
$fields, $order, $limit, $page));
}
First I tried to urlencode my query variable, but that somehow broke
the routing I guess. So I changed it to base64 encoding, that works
now. It makes for a funky long URL, but it works. And I rather have my
audience not see the query information in the URL. They might get
ideas. hehe
So this is how my pagination links look like now:
http://www.mydomain.com/cakeapp/mycontroller/index/bGlzdHByaWNlIDw9IDE1MDAwMCBBTkQgKHByb3BzdWJ0eXBlID0gJ0xPRlQnIE9SIHByb3BzdWJ0eXBlID0gJ0NPTkRPTUlOSVVNJyBPUiBwcm9wc3VidHlwZSA9ICdEVVBMRVgnIE9SIHByb3BzdWJ0eXBlID0gJ1RPV05IT1VTRScgT1IgcHJvcHN1YnR5cGUgPSAnRk9VUlBMRVgnIE9SIHByb3BzdWJ0eXBlID0gJ1RSSVBMRVgnKSBBTkQgKHppcGNvZGUgPSAnNzg3NTknKQ==/?page=2
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---