2017 © Pedro Peláez
 

package yii2-excel-exchange

Yii2 extension for exchanging a data from DB to excel and back again for Yii2 Framework.

image

uranum/yii2-excel-exchange

Yii2 extension for exchanging a data from DB to excel and back again for Yii2 Framework.

  • Monday, May 7, 2018
  • by Eugeny_Emelyanov
  • Repository
  • 1 Watchers
  • 0 Stars
  • 91 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 11 Versions
  • 3 % Grown

The README.md

Yii 2 Excel Data Exchanger

After installing this package you will be able to export data from DB to an excel2007 file and upload the data back again. The package is a module that you need to register in the config file in the module section. The module has a widget that you can use with different AR models in the usual way (for widgets). In the widget's config you need to specify the model name you want to import/export. Other optional properties are listed below., (*1)

If the exporting model has a related table the file will have an additional sheet for every table even the ones which don’t have a model. The data in these additional sheets helps to handle related columns. This sheets will be ignored in importing., (*2)

Required fields are highlighted in the excel file., (*3)

Note! One file is used for all models! The new exporting will overwrite existing file., (*4)

Required fields, (*5)

There is a feature to backup the table before importing., (*6)

Export, (*7)

Export, (*8)

Import, (*9)

Import, (*10)

Installation

The preferred way to install this extension is through composer., (*11)

Either run, (*12)

php composer.phar require --prefer-dist uranum/yii2-excel-exchange

or add, (*13)

"uranum/yii2-excel-exchange": "*"

to the require section of your composer.json file., (*14)

In config, modules section

    'modules' => [
//      ...
        'excel' => [
            'class'  => 'uranum\excel\Module',
            'params' => [
                'uploadPath' => 'uploads', // the path relative to the root
                'fileName'   => 'export',
                'extensions' => 'xls, xlsx',
            ],
        ],
    ],

How to use

In view (for example, index.php)

use uranum\excel\ExcelExchanger;

//...

echo ExcelExchanger::widget([
    'mainModelName' => $searchModel::className(), // here place model class name
 ]);

Widget's properties

string $mainModelName - the name of the model for export/import. It's mandatory property., (*15)

string $fileNameFrom - path to a file for export/import. Default is 'uploads/export.xlsx'. The folder must be exist!, (*16)

string $notNullColumnColor - a value of the color for required columns. Default is 'FFDECC', (*17)

string $nameOfReserveTable - prefix for the copied table. Default is 'archive_', (*18)

string $backupUrl - url for backup action. Default is 'excel/default/backup'. You can create your own controller with it's actions and change the urls here., (*19)

string $uploadUrl - url for upload action. Default is 'excel/default/upload', (*20)

string $importUrl - url for import action. Default is 'excel/default/import', (*21)

string $exportUrl - url for export action. Default is 'excel/default/export', (*22)

integer $columnWidthOfStringType - a value of the column's width that has string type. Default is 35, (*23)

integer $columnWidthOfTextType - a value of the column's width that has text type. Default is 50, (*24)

integer $columnWidthDefault - a value of the other column's width. Default is 15, (*25)

string $modalId - a value of the Modal id. Default is 'excelImportModal', (*26)

string $fileInputId - a value of the fileInput field id. Default is 'uploadFile', (*27)

string $exportBtnClass is the part of css bootstrap class. Default is 'ExcelExchanger::COLOR_SUCCESS', (*28)

string $uploadBtnClass is the part of css bootstrap class. Default is 'ExcelExchanger::COLOR_SUCCESS', (*29)

string $uploadDataBtnClass is the part of css bootstrap class. Default is 'ExcelExchanger::COLOR_SUCCESS', (*30)

string $importPopupBtnClass is the part of css bootstrap class. Default is 'ExcelExchanger::COLOR_DANGER', (*31)

string $panelColorClass is the part of css bootstrap class. Default is 'ExcelExchanger::COLOR_DEFAULT', (*32)

string $fileInputColorClass is the part of css bootstrap class. Default is 'ExcelExchanger::COLOR_WARNING', (*33)

The Versions

07/05 2018

dev-master

9999999-dev

Yii2 extension for exchanging a data from DB to excel and back again for Yii2 Framework.

  Sources   Download

MIT BSD-3-Clause

The Requires

 

The Development Requires

yii2 yii 2 yii excel exchange data export excel import excel

07/05 2018

1.1.8

1.1.8.0

Yii2 extension for exchanging a data from DB to excel and back again for Yii2 Framework.

  Sources   Download

MIT

The Requires

 

The Development Requires

yii2 yii 2 yii excel exchange data export excel import excel

19/03 2018

1.1.7

1.1.7.0

Yii2 extension for exchanging a data from DB to excel and back again for Yii2 Framework.

  Sources   Download

MIT

The Requires

 

The Development Requires

yii2 yii 2 yii excel exchange data export excel import excel

19/03 2018

1.1.6

1.1.6.0

Yii2 extension for exchanging a data from DB to excel and back again for Yii2 Framework.

  Sources   Download

MIT

The Requires

 

The Development Requires

yii2 yii 2 yii excel exchange data export excel import excel

19/03 2018

1.1.3

1.1.3.0

Yii2 extension for exchanging a data from DB to excel and back again for Yii2 Framework.

  Sources   Download

MIT

The Requires

 

The Development Requires

yii2 yii 2 yii excel exchange data export excel import excel

13/10 2016

1.1.2

1.1.2.0

Yii2 extension for exchanging a data from DB to excel and back again for Yii2 Framework.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

yii2 yii 2 yii excel exchange data export excel import excel

24/09 2016

1.1.1

1.1.1.0

Yii2 extension for exchanging a data from DB to excel and back again for Yii2 Framework.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

yii2 yii 2 yii excel exchange data export excel import excel

23/09 2016

1.1.0

1.1.0.0

Yii2 extension for exchanging a data from DB to excel and back again for Yii2 Framework.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

yii2 yii 2 yii excel exchange data export excel import excel

20/09 2016

1.0.2

1.0.2.0

Yii2 extension for exchanging a data from DB to excel and back again for Yii2 Framework.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

yii2 yii 2 yii excel exchange data export excel import excel

20/09 2016

1.0.1

1.0.1.0

Yii2 extension for exchanging a data from DB to excel and back again for Yii2 Framework.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

yii2 yii 2 yii excel exchange data export excel import excel

19/09 2016

1.0.0

1.0.0.0

Yii2 extension for exchanging a data from DB to excel and back again for Yii2 Framework.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

yii2 yii 2 yii excel exchange data export excel import excel