{"id":20207078,"url":"https://github.com/koolreport/codeigniter4-example","last_synced_at":"2026-05-15T07:03:01.559Z","repository":{"id":88465662,"uuid":"388382000","full_name":"koolreport/codeigniter4-example","owner":"koolreport","description":null,"archived":false,"fork":false,"pushed_at":"2021-07-27T08:11:59.000Z","size":4472,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-13T20:49:57.423Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/koolreport.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-22T08:15:48.000Z","updated_at":"2021-07-27T08:12:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"4e3e745d-652a-482f-81c3-3659c5427886","html_url":"https://github.com/koolreport/codeigniter4-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koolreport%2Fcodeigniter4-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koolreport%2Fcodeigniter4-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koolreport%2Fcodeigniter4-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koolreport%2Fcodeigniter4-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koolreport","download_url":"https://codeload.github.com/koolreport/codeigniter4-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241644543,"owners_count":19996177,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T05:27:22.980Z","updated_at":"2026-05-15T07:03:01.470Z","avatar_url":"https://github.com/koolreport.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# How to use KoolReport in CodeIgniter 4?\n\nCodeIgniter is a PHP full-stack web framework that is light, fast, flexible and secure.\n\nKoolReport is reporting framework and can be integrated into CodeIgniter or any other MVC framework. KoolReport help you to create data report faster and easier.\n\nIn this repository, we would like to demonstrate how KoolReport can be used in CodeIgniter.\n\n# Guide\n\n## Installation\n\nRun `composer` command in your CodeIgniter directory to install `koolreport/core` and `koolreport/codeigniter`\n\n```\ncomposer require koolreport/core\ncomposer require koolreport/codeigniter\n```\nor install `koolreport/pro` if you have a license for it\n\n```\ncomposer require koolreport/pro\n```\n\n## Step to make reports\n\n1. Inside `app` directory, create `reports` subdirectory to hold your reports.\n2. Create `MyReport.php` and `MyReport.view.php` inside `reports` directory. Assign `App\\reports` namespace for the report if you want it be autoloaded. Otherwise, you could include the report file directly in your controller. Please see the contents of two files in our repository.\n3. Add \\koolreport\\codeigniter\\Friendship trait to your report like following:\n\n```\nclass MyReport extends \\koolreport\\KoolReport\n{\n    use \\koolreport\\codeigniter\\Friendship;\n    ...\n```\nThis trait would help the report to publish js, css assets to CodeIgniter's `public` directory in a subdirectory called `asset/koolreport_assets` as well as allow using CodeIgniter's database settings in the report.\n\n### Create route and action\n\nIn `app/Config/Routes.php`, create a route to your report and its action with a controller:\n\n```\n$routes-\u003eget('/customReport', 'Home::customReport');\n```\nIn the `Home` controller (`app/Controllers/Home.php`), create the action method:\n\n```\npublic function customReport()\n{\n    $report = new \\App\\reports\\MyReport();\n    //or if your report doesn't have a namespace:\n    //include APPPATH . \"reports/MyReport.php\";\n    //$report = new \\MyReport();\n    $report_content = $report-\u003erun()-\u003erender(true);\n    return view(\"customReport\", [\"report_content\" =\u003e $report_content]);\n}\n```\nCreate the report view `app/Views/customReport.php` and put your report content anywhere you like:\n\n```\n\u003chtml\u003e\n...\n\u003c?php echo $report_content; ?\u003e\n\u003c/html\u003e\n```\n\nAll done!\n\n## View result\n\nFirst start the PHP built-in server in your CodeIgniter directory:\n\n\n```\nphp spark serve\n```\nThen you can access after running\n\n```\nhttp://locahost:8080/customReport\n```\n\nyou will see\n\n![](codeigniter4_combochart.png)\n\n\n# Summary\n\nKoolReport is a great php reporting framework. You can use KoolReport alone with pure php or inside any modern MVC frameworks like CodeIgniter, CakePHP, Laravel, Symfony, Yii2. If you have any questions regarding KoolReport, free free to contact us at [our forum](https://www.koolreport.com/forum/topics) or email to [support@koolreport.com](mailto:support@koolreport.com).\n\n__Happy Reporting!__","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoolreport%2Fcodeigniter4-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoolreport%2Fcodeigniter4-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoolreport%2Fcodeigniter4-example/lists"}