koolreport/codeigniter
Composer 安装命令:
composer require koolreport/codeigniter
包简介
Allow to use KoolReport seamlessly in CodeIgniter
关键字:
README 文档
README
CodeIgniter is without doubt one of the most powerful PHP Framework. it is built with small foot print, simple with ability to create full-featured web applications.
Since we created KoolReport we received many questions like "How to use KoolReport in CodeIgniter?". The answer is KoolReport was designed to work with any PHP Frameworks and CodeIgniter is one of them. The setting to make them work together is simple but we want to make things simpler.
So we created this CodeIgniter pakage, an extension to let KooLReport work seamlessly inside CodeIgniter environment and providing powerful reporting capability for your CI application. This package will help us to
- Access CodeIgniter database in report created with Koolreport
- Automatically publish report resources to CodeIniter's assets folder
All with a simple line of code
use \koolreport\codeigniter\Friendship;
Requirement
- KoolReport >= 2.75.0
- CodeIgniter >= 3.0.0
Installation
By downloading .zip file
- Download
- Unzip the zip file
- Copy the folder
codeigniterintokoolreportfolder so that look like below
koolreport ├── core ├── codeigniter
By composer
composer require koolreport/codeigniter
Documentation
Friendship
In order for a report to access CodeIgniter databases, we will claim the friendship with CodeIgniter in the report.
class MyReport extends \koolreport\KoolReport
{
use \koolreport\codeigniter\Friendship;// All you need to do is to claim this friendship
function setup()
{
//Now you can access database that you configured in codeigniter
$this->src("sale_database")
->query("select * from orders")
->pipe($this->dataStore("orders"));
}
}
As you may see from above code, our MyReport now can access all database resources of CodeIgniter through simple line of code. Moreover, the MyReport will configured itself to publish its neccessary resources to public folder of CodeIgniter. Everything just work!
Adding another datasources
In some cases, you have other sources of data that you would like to include into the report, you can just write normal settings() function as you normally do in KoolReport.
class MyReport extends \koolreport\KoolReport
{
use \koolreport\codeigniter\Friendship;
function settings()
{
return array(
"dataSources"=>array(
"csv_source"=>array(
"class"=>'\koolreport\datasources\CSVDataSource',
'filePath'=>dirname(__FILE__)."\mycsvdata.csv",
)
)
);
}
function setup()
{
//Now you can access database that you configured in codeigniter
$this->src("sale_database")
->query("select * from orders")
->pipe($this->dataStore("orders"));
$this->src("csv_source")
->pipe(...)
...
->pipe($this->dataStore("csv"));
}
}
As you can see from above code, you have access both to sale_database from CodeIgniter as well as extra csv_source.
Customize assets location
By default, the report which has friendship with CodeIgniter will automatically export all of its resources to default location which is {project_folder}/assets/koolreport_assets. But in any case, you do not like this settings or just want to organize folder differently you can manually set it up like below:
class MyReport extends \koolreport\KoolReport
{
use \koolreport\codeigniter\Friendship;
function settings()
{
return array(
"assets"=>array(
"url"=>"myassets",
"path"=>"../myassets" // or "path"=>"/var/html/CIProject/myassets"
)
);
}
The path can be relative path from your report to assets folder or it can be absolute path.
The url is url to assets folder that can be accessed through browser.
Support
Please use our forum if you need support, by this way other people can benefit as well. If the support request need privacy, you may send email to us at support@koolreport.com.
koolreport/codeigniter 适用场景与选型建议
koolreport/codeigniter 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 194.11k 次下载、GitHub Stars 达 6, 最近一次更新时间为 2019 年 05 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「laravel」 「Data Report」 「Reporting Tools」 「KooLReport CodeIgniter」 「CodeIgniter Report」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 koolreport/codeigniter 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 koolreport/codeigniter 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 koolreport/codeigniter 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Shoot aims to make providing data to your templates more manageable
Adds the EDTF data type to Wikibase
A simple library that allows transform any kind of data to native php data or whatever
Data provider for yii2
A CakePHP behavior to validate foreign keys
Common interface for interacting with data in objects and arrays.
统计信息
- 总下载量: 194.11k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-05-09