moonlandsoft / yii2-phpexcel

Exporting PHP to Excel
MIT License
135 stars 89 forks source link

problem in Usage samples #6

Closed phpniki closed 8 years ago

phpniki commented 8 years ago

Hi dear you have problem in your usage samples in 'header' it should be 'headers' not 'header' for example

\moonland\phpexcel\Excel::widget([
    'models' => $allModels,
    'mode' => 'export', //default value as 'export'
    'columns' => ['column1','column2','column3'], //without header working, because the header will be get label from attribute label. 
    'header' => ['column1' => 'Header Column 1','column2' => 'Header Column 2', 'column3' => 'Header Column 3'], 
]);  

should be

\moonland\phpexcel\Excel::widget([
    'models' => $allModels,
    'mode' => 'export', //default value as 'export'
    'columns' => ['column1','column2','column3'], //without header working, because the header will be get label from attribute label. 
    'headers' => ['column1' => 'Header Column 1','column2' => 'Header Column 2', 'column3' => 'Header Column 3'], 
]);
avarik-anam commented 8 years ago

I so sorry, i know that is wrong. I will update the example usage later.

Thank's for your support.

avarik-anam commented 8 years ago

Sorry, i am late to update this repository. the usage sample has been updated.