PhpExcel
PhpExcel copied to clipboard
Plugin install
Hello,
I might miss something obvious : I get the message "Missing Plugin" but I don't see any file that is supposed to go into the app/plugin
Where am I wrong ?
Thanks in advance, best regards
Fred
Hi Fred,
I wrote my own instructions in here, but segy closed it and replied with this message:
"Hi sorry, but please read how to use plugins in cake: http://book.cakephp.org/2.0/en/plugins.html Best regards"
maybe you should take a look at it too.
Ransey
Hi Ransey,
Thank you for helping. I had seen your contribution and looked to the linked page where it seems that a plugin is usually installed in the plugin folder… But I still don't get which files have to be there from the package I have downloaded. Do you ?
Best regards, Fred
Hi guys. This is a plugin. You should download (or fork) this into your application plugin/PhpExcel folder. So one more time... this is not a self standing cakephp app. It is a plugin.
Hi Segy,
Thanks for helping.
I have put everything in the app/plugin/PhpExcel folder but I have this error : Fatal error: Unsupported operand types in (…)/lib/Cake/Core/CakePlugin.php on line 78
I think I still miss something… Best regards,
Fred
Hello. I am sorry but I missed this one. Do you still need my help?
I know this is an old thread, but for posterity, here's how I got it to work. Really simple:
- You should put the entire plugin in app/Plugin:
app
|
+-- Plugin
| |
| +-- PhpExcel
| |
| +-- Controller
| +-- Vendor
| +-- View
- Edit your app/Config/bootstrap.php file and include this:
CakePlugin::load('PhpExcel');
- In your controller:
class MyController extends AppController {
// load the PhpExcel component - case is important
public $components = array('PhpExcel.PhpExcel');
/**
* Open an Excel file
*/
function openexcel() {
$fileName = './uploads/sample.csv';
$objPhpExcel = $this->PhpExcel->loadWorksheet($fileName);
// debug
var_dump($objPhpExcel);
}
}
- If all is well, you should see the object dumped:
object(PhpExcelComponent)[28]
protected '_xls' =>
object(PHPExcel)[35]
private '_uniqueID' => string '55de3050834e4' (length=13)
private '_properties' =>
object(PHPExcel_DocumentProperties)[53]
private '_creator' => string 'Unknown Creator' (length=15)
private '_lastModifiedBy' => string 'Unknown Creator' (length=15)
private '_created' => int 1440624720
private '_modified' => int 1440624720
private '_title' => string 'Untitled Spreadsheet' (length=20)
...
Hi segy, Thanks for your plugin. I've got the same problem as another people. I thnk people frustrated because in the header : PhpExcel helper and component for CakePHP 2.x Change name to Plugin and nobody never will ask how install it :)