Closed Bird87ZA closed 8 years ago
@Bird87ZA how did you load the plugin? And can you gist your config/routes.php
file?
Installed it with composer. and then in bootstrap.php I have this line:
Plugin::load('CakeExcel', ['bootstrap' => true, 'routes' => true]);
Move the Router::extensions('xlsx')
call to here: https://gist.github.com/Bird87ZA/2cd58b3251e7448d3a405d8684663a23#file-routes-php-L43
Works now. Thanks! :) Perhaps just add that in the Readme. :)
I have everything set up as per the README file.
I've copied and pasted the
config/bootstrap.php
andconfig/routes.php
lines. In myAppController.php
file I have set up theRequestHandler
component as required and I have a default template inTemplate\Layout\xlsx\default.ctp
containing the one line as suggested.I added the link (
$this->Html->link('Excel file', ['_ext' => 'xlsx'])
the controller'sindex.ctp
file, and I have axlsx\index.ctp
file in the Template directory. When I load the page, the link is echo'd aslocalhost\site\example.xlsx
where controller is the name of the controller. Clicking on this, it gives me aController class Example.xlsx could not be found.
error. When I type the URLlocalhost\site\example\index.xlsx
in the address bar, I getError: Create ExampleController::index.xlsx() in file: src\Controller\ExampleController.php.
error.What am I doing wrong?