I am building a search form which allows users to search for Jobs by
category, location & job title.
My controller code is as follows:
function search() {
if(!empty($this->data)) {
$title = $this->data['Job']['title'];
$location = $this->data['Job']['location'];
$this->paginate = array(
'conditions' => array(
'AND' => array(
'Job.status'
=> 'A',
'Job.title
like' => '%' . $title . '%',
'Job.location
like' => '%' . $location . '%',
'Job.job_category_id' => $this->data['Job']
['job_category_id'],
)
),
'limit' => 5,
'order' => array(
'Job.type' => 'asc',
'Job.id' => 'desc'
)
);
$data = $this->paginate('Job');
$this->set(compact('data'));
}
....
I have the following code in my view:
<? echo $paginator->options(array('update' => 'content', 'url' =>
serialize($this->data), 'indicator' => 'spinner')); ?>
But when I tried to unserialize the data, it is giving the following
error:
Notice (8): unserialize() [function.unserialize]: Error at offset 0 of
134 bytes
How can I implement the pagination, such that all the form values are
retained ?
- Thanks
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---