Skip to content

This is a utility extension for data import and export as various format such as Office Excel and csv.

Notifications You must be signed in to change notification settings

Rowe/yii2-dataupdown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

yii2-dataupdown

这是一个用于从数据库导出导入数据为指定格式的工具扩展

Usage

$model = new CustomerSearch();
$dataProvider = $model->search(Yii::$app->request->queryParams);
$models = $dataProvider->query->all();
Yii::createObject([
    'class' => OfficeExporter::className(),
    'dataLayout' => Yii::createObject([
        'class' => DataLayout::className(),
        'models' => $models,
        'columns' => [
            [
                'attribute' => 'updated_at',
                'format' => ['date', 'php:Y-m-d'],
            ],
            'capital',
            'company_name',
            'family_name',
            'given_name',

            'mobile',
            [
                'attribute' => 'date',
                'format' => ['date', 'php:Y-m-d'],
            ],
        ]
    ])
])->handle();

About

This is a utility extension for data import and export as various format such as Office Excel and csv.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages