arogachev / yii2-excel

ActiveRecord import and export based on PHPExcel for Yii 2 framework
Other
64 stars 25 forks source link

PHPExcel_RichText problems #43

Open sashsvamir opened 7 years ago

sashsvamir commented 7 years ago

If any cell contain text with different font styles, value of this cell getted as PHPExcel_RichText object. To prevent validate error of this value now i'm use function:

'valueReplacement' => function ($value) {
    return ($value instanceof \PHPExcel_RichText) ? $value->getPlainText() : $value;
}

But i want get plain text for all cells and don't want write valueReplacement function for every property. Can you give me advice, may be exist more best solution to resolve this point. Or may be possible to add configure option for Importer component to use all cells data only as plain text.