Download the PHP package gevman/yii2-excel-import without Composer
On this page you can find all versions of the php package gevman/yii2-excel-import. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download gevman/yii2-excel-import
More information about gevman/yii2-excel-import
Files in gevman/yii2-excel-import
Download gevman/yii2-excel-import
More information about gevman/yii2-excel-import
Files in gevman/yii2-excel-import
Vendor gevman
Package yii2-excel-import
Short Description Export excel sheets to ActiveRecord models
License MIT
Package yii2-excel-import
Short Description Export excel sheets to ActiveRecord models
License MIT
Please rate this library. Is it a good library?
Informations about the package yii2-excel-import
Yii2 Excel Importer
Import excel to ActiveRecord models
installation
using composer
methods
__constructor
supports array parameter with following attributes
filePath
- full path to excel file to be importedactiveRecord
- ActiveRecord class name where imported data should be savedscenario
- ActiveRecord scenario, if leave empty no scenario will be setskipFirstRow
- if true will skip excel's first row (eg. heading row), otherwise will try save first row alsofields[]
- array of field definitions
fields[]
attribute
- attribute name from Your ActieRecord classvalue
- if callable passed it will receive current row, and return value will be saved to AR, otherwise it will find element which key is passed value in current row
validate
validates each populated AR model, and returns false if there's any error, otherwise it will return true
save
Saves populated AR models, and returns an array of each saved AR model's primary key if models is not validated yet, it will validate all models before save
getErrors
Will return array of AR model errors indexed by row's index
getModels
Will return array of populated AR models
examples
-
Define Fields
- Validate, Save, and show errors
of just
All versions of yii2-excel-import with dependencies
PHP Build Version
Package Version
The package gevman/yii2-excel-import contains the following files
Loading the files please wait ....