yexcel Excel file reader for Yii Framework

  1. Requirements
  2. Usage
  3. Resources

Excel file reader for Yii Framework.

Requirements

Yii 1.1 above

Usage

Within your configuration files (usually found under /protected/config/) there is the "components" section. Just like your db and cache components, we'll need to add in our own configuration for this. Add in the following code within the components section:

'yexcel' => array(
    'class' => 'ext.yexcel.Yexcel'
),

Simple usage of this extenstion:

$sheet_array = Yii::app()->yexcel->readActiveSheet($file_path);

echo "<table>";

foreach( $sheet_array as $row ) {
    echo "<tr>";
    foreach( $row as $column )
        echo "<td>$column</td>";
    echo "</tr>";
}

echo "</table>";

//or

//echo first cell of excel file
echo $sheet_array[1]['A'];
        

Resources

6 0
12 followers
5 136 downloads
Yii Version: 1.1
License: GPL-3.0
Category: File System
Tags: excel
Developed by: Michel Kogan
Created on: Oct 30, 2012
Last updated: 12 years ago

Downloads

show all

Related Extensions