The preferred way to install this extension is through composer.
php composer.phar require serrg1994/yii2-csv-export "@dev"
or add
"serrg1994/yii2-csv-export": "@dev"
to the require section of your composer.json.
CSVExport::Export([
'dirName' => Yii::getAlias('@webroot'),
'fileName' => 'users.csv',
'data' => [
['#', 'User Name', 'Email'],
['1', 'Serhiy Novoseletskiy', '[email protected]']
]
]);