# Import module

## Installation via composer

 ```composer require ciext/import 3.*```
 
## Integration into controller
```
public function import()
{
    $this->load->library('import/import_api')
        ->set_table('TABLE_NAME')
        ->set_uniq_field('unique field in the table to synchronize')
        ->set_columns(['COLUMN1'])
        ->display_as('COLUMN1', 'COLUMN_LABEL1');

    return ['content' => $this->import_api->render(), 'title' => $this->lang->line('Import Business')];
}
```
  
## Integration into rtgrid
```
$this->crud->add_top_action(new rtgrid_top_action(
    'import',
    '<a href="' . base_url($this->config->item('admin_page') . '/mconfig/index/business/import') . '" class="btn"><i class="fa fa-cloud-upload"></i> ' . $this->lang->line('Import') . '</a>'
));
```