Question: This is my join query code:

```
$options['joins'] = array(
                array('table' => 'employees',
                    'alias' => 'Employees',
                    'type' => 'INNER',
                    'foreignKey' => 'employee_id',
                    // 'fields' => 'Users.user', <- get rid of this
                    'conditions' => array(
                        'TravancoDSREmployee.emp_id = Employees.employee_id'
                    )
                )
            );
        $options['fields'] = array('TravancoDSREmployee.*','Employees.*'); // <- insert this
        $options['conditions'] = array( 'TravancoDSREmployee.created_emp_id' => $emp_id);
        $result = $this->TravancoDSREmployee->find('all', $options);
        $this->set('result', $result);

```

I want to set it with pagination.

How can i do this?

Answer: 
Please look on url given below.

<http://garbers.co.za/2011/05/03/easy-way-to-generate-cakephp-habtm-joins-for-use-in-pagination/>

Code You can try is

```
$fields = array('TravancoDSREmployee.*','Employees.*'); // <- insert this
$conditions = array( 'TravancoDSREmployee.created_emp_id' => $emp_id);
$joins = array();
$joins[] = array(
    'table' => 'employees',
            'alias' => 'Employees',
            'type' => 'INNER',
            'foreignKey' => 'employee_id',
            // 'fields' => 'Users.user', <- get rid of this
            'conditions' => 'TravancoDSREmployee.emp_id = Employees.employee_id',
      );

$this->paginate = compact('fields' , 'joins' , 'conditions');
$result = $this->paginate('TravancoDSREmployee');
$this->set('result', $result);

```

I hope it will be helpful for you,

thanks
First, you must pass your condition to paginate property in your controller. After it, you can call paginate function. Cange your $result to become:

```
$this->paginate = array('TravancoDSREmployee' => $options);
$result = $this->paginate('TravancoDSREmployee');
$this->set('result', $result);

```