PhpExcel icon indicating copy to clipboard operation
PhpExcel copied to clipboard

Plugin install

Open fred6b12 opened this issue 10 years ago • 7 comments

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

fred6b12 avatar Jul 23 '14 15:07 fred6b12

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

ranseyb avatar Jul 23 '14 19:07 ranseyb

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

fred6b12 avatar Jul 23 '14 20:07 fred6b12

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.

segy avatar Jul 24 '14 08:07 segy

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

fred6b12 avatar Jul 24 '14 09:07 fred6b12

Hello. I am sorry but I missed this one. Do you still need my help?

segy avatar Jan 09 '15 17:01 segy

I know this is an old thread, but for posterity, here's how I got it to work. Really simple:

  1. You should put the entire plugin in app/Plugin:
app
 |
 +-- Plugin
 |    |  
 |    +-- PhpExcel    
 |         |
 |         +-- Controller  
 |         +-- Vendor
 |         +-- View
  1. Edit your app/Config/bootstrap.php file and include this:
CakePlugin::load('PhpExcel');
  1. 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);
    }

}
  1. 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)
          ...

JasonBaier avatar Aug 26 '15 21:08 JasonBaier

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 :)

notRuslan avatar Sep 14 '16 16:09 notRuslan