dakota / CakeExcel

A plugin to generate Excel files with CakePHP. Uses the PHPExcel library.
MIT License
22 stars 25 forks source link

Plugin ist not loadable #5

Closed thorus90 closed 8 years ago

thorus90 commented 9 years ago

Hi,

I followed the instructions in the README but I can't load the plugin.

My composer.json:

{ "name": "cakephp/app", "description": "CakePHP skeleton app", "homepage": "http://cakephp.org", "type": "project", "license": "MIT", "require": { "php": ">=5.4.16", "cakephp/cakephp": "~3.0", "mobiledetect/mobiledetectlib": "2.", "cakephp/migrations": "~1.0", "cakephp/plugin-installer": "", "dakota/cake-excel": "3.0.x-dev" }, "require-dev": { "psy/psysh": "@stable", "cakephp/debug_kit": "~3.0", "cakephp/bake": "~1.0" }, "suggest": { "phpunit/phpunit": "Allows automated tests to be run without system-wide install.", "cakephp/cakephp-codesniffer": "Allows to check the code against the coding standards used in CakePHP." }, "autoload": { "psr-4": { "App\": "src" }, "files": [ "vendor/xtcpdf.php" ] }, "autoload-dev": { "psr-4": { "App\Test\": "tests", "Cake\Test\": "./vendor/cakephp/cakephp/tests" } }, "scripts": { "post-install-cmd": "App\Console\Installer::postInstall", "post-autoload-dump": "Cake\Composer\Installer\PluginInstaller::postAutoloadDump" }, "minimum-stability": "dev", "prefer-stable": true }

my config/bootstrap.php:

Plugin::load('Dakota\CakeExcel', ['bootstrap' => true, 'routes' => true]);

The error I get:

Make sure your plugin Dakota\CakeExcel is in the /var/www/otrs.fis-asp.de/htdocs/cake/plugins/ directory and was loaded.

Is it a bug of cakehphp that the error message indicates its searching for the plugin in plugins? or a misconfiguration on my end? Because in cakephp3 it should search in vendor...

There is dakota/cake-excel and the file cakephp-plugins.php maps that correctly.

Can anyone help me finding the problem? Thanks!

BenjaminLamperier commented 9 years ago

There is a mistake in the documentation, Try Plugin::load('Dakota/CakeExcel', ['bootstrap' => true, 'routes' => true]); Rather than Plugin::load('Dakota\CakeExcel', ['bootstrap' => true, 'routes' => true]);

thorus90 commented 9 years ago

Thanks the plugin is now loadable.

But according to the documentation, in my view I should now have access to the Class via $this->PhpExcel, but I get the Missing Helper error:

Error: PhpExcelHelper could not be found.

Did I do sth wrong?

Thanks

BenjaminLamperier commented 9 years ago

strange ... did you add the request handler component in your controller ?

thorus90 commented 9 years ago

Yes,

cat src/Controller/AppController.php

<?php /**

use Cake\Controller\Controller;

/**

}

Is this correct?

alexel200 commented 6 years ago

Hi, I'm having the same issue, have you solved?. I have downloaded dakota/cakeexcel from composer and cake says me "Helper class PhpExcelHelper could not be found. ", when I use $this->PhpExcel.

Thanks in advance!

josegonzalez commented 6 years ago

@alexel200 please file another issue with your exact installation steps.