承接 jdominguezpaz/cakespreadsheet 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jdominguezpaz/cakespreadsheet

最新稳定版本:1.0.0

Composer 安装命令:

composer require jdominguezpaz/cakespreadsheet

包简介

CakePHP excel spreadsheet generator using PHPSpreadsheet (CakePHP 3.x compatible, fixed for 3.8+)

README 文档

README

Build Status Coverage Status Total Downloads Latest Stable Version

CakeSpreadsheet

A plugin to generate Excel spreadsheet files with CakePHP 3.x.

This is a maintained fork of chrmina/CakeSpreadsheet, which was modified from CakeExcel to use PHPSpreadsheet instead of obsolete PHPExcel.

Key Changes in This Fork

  • Fixed deprecation warnings for CakePHP 3.8+
  • Updated to use modern CakePHP 3.x APIs (Event::getSubject(), setConfig())
  • Active maintenance and versioning
  • Ready for Composer/Packagist distribution

Requirements

  • CakePHP 3.6+
  • PHP 5.6.0 or greater
  • Patience

Installation

[Using Composer]

composer require jdominguezpaz/cakespreadsheet

Enable plugin

Load the plugin in your app's config/bootstrap.php file:

Plugin::load('CakeSpreadsheet', ['bootstrap' => true, 'routes' => true]);

Usage

First, you'll want to setup extension parsing for the xlsx extension. To do so, you will need to add the following to your config/routes.php file:

# Set this before you specify any routes
Router::extensions('xlsx');

Next, we'll need to add a viewClassMap entry to your Controller. You can place the following in your AppController:

$this->loadComponent('RequestHandler', ['viewClassMap' => ['xlsx' => 'CakeSpreadsheet.Spreadsheet'], 'enableBeforeRedirect' => false]);

Each application must have an xlsx layout. The following is a barebones layout that can be placed in src/Template/Layout/xlsx/default.ctp:

<?= $this->fetch('content') ?>

Finally, you can link to the current page with the .xlsx extension. This assumes you've created an xlsx/index.ctp file in your particular controller's template directory:

$this->Html->link('Excel file', ['_ext' => 'xlsx']);

Inside your view file you will have access to the PHPSpreadsheet library with $this->Spreadsheet. Please see the PHPSpreadsheet documentation for a guide on how to use PHPSpreadsheet.

License

The MIT License (MIT)

Copyright (c) Christakis Mina

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

统计信息

  • 总下载量: 3
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-31

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固