genesisaplicaciones/genesis-php-tools
最新稳定版本:1.3.12
Composer 安装命令:
composer require genesisaplicaciones/genesis-php-tools
包简介
Some libraries and helper functions commonly used by the Genesis Aplicaciones developer team across different solutions.
README 文档
README
Some libraries and helper functions commonly used by the Genesis Aplicaciones developer team across different solutions.
Libraries included
SpreadSheetTemplate.php
Quicky generate a spreadsheet document based on a common template with minimun configuration, but allowing you to customize several parameters, like:
- owner_info
- logo
- logo_wide
- logo_square
- solution_name
- title
- subject
- category
- last_modified_by
- table_color
- color_title_bg
- color_title_font
- color_headers_bg
- color_table_border
- memory_limit
For the table data, you can pass the raw data array from a database query and especify excluded columns and edit the names by overwriting all or only renaming the ones needed. Also, when generating the file you cant force the download directly or you can return the bin file and do what you want whith it (like a base64_encode).
Examples
Minimal effort setup:
// this way you get the report with the same data you pass and force the download $template = new GenesisPhpTools\SpreadSheetTemplate(); // Initialice the class with the default configuration $template->generate_file( "usuarios", //the report name $datos_reporte, //report data true, // force the download of the file );
Advanced usage:
// this way you get the report with excluded and renamed columns, a logo, custom color and correct file metadata $doc_config = [ 'owner_info' => $this->session->razon_social, 'logo' => 'assets/panel/img/logo.png', 'solution_name' => 'TimbraXML', 'table_color' => 'FF0C77C2' ]; $columns_config = [ "excluded" => ['id_cuenta', 'id_usuario'] , "renamed" => [ "control_access" => "Acceso al portal", "panel_access" => "Nivel de acceso", "vista" => "Tipo de facturacion" ] ]; $template = new GenesisPhpTools\SpreadSheetTemplate($doc_config); // Initialice the class with the default configuration $my_file = $template->generate_file( "usuarios", //the report name $datos_reporte, //report data false, // don't force the download of the file, so you can manipulate it $columns_config, ); return_data(base64_encode($my_file)); // return the data like you want, in this case in base64 inside a json response
统计信息
- 总下载量: 122
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-08-13

