{"id":20207037,"url":"https://github.com/koolreport/yii2","last_synced_at":"2026-05-13T09:01:24.622Z","repository":{"id":57008508,"uuid":"234523554","full_name":"koolreport/yii2","owner":"koolreport","description":"Ease the report created inside Yii2 environment","archived":false,"fork":false,"pushed_at":"2020-01-21T09:50:25.000Z","size":2,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-01T08:34:18.046Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/koolreport.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-17T10:12:41.000Z","updated_at":"2020-12-04T18:06:55.000Z","dependencies_parsed_at":"2022-08-21T14:31:14.346Z","dependency_job_id":null,"html_url":"https://github.com/koolreport/yii2","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/koolreport/yii2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koolreport%2Fyii2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koolreport%2Fyii2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koolreport%2Fyii2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koolreport%2Fyii2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koolreport","download_url":"https://codeload.github.com/koolreport/yii2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koolreport%2Fyii2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32975183,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T06:31:55.726Z","status":"ssl_error","status_checked_at":"2026-05-13T06:31:51.336Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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:14.974Z","updated_at":"2026-05-13T09:01:24.585Z","avatar_url":"https://github.com/koolreport.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Introduction\n\n`koolreport/yii2` package helps to ease the KoolReport report created within Yii2 environment. It can help to automatically configure `assets` path and url. Furthermore, it provide `default` datasource configured with Yii2 database connection.\n\n# Installation\n\n## By downloading .zip file\n\n1. [Download](https://www.koolreport.com/packages/yii2)\n2. Unzip the zip file\n3. Copy the folder `yii2` into `koolreport` folder so that look like below\n\n```bash\nkoolreport\n├── core\n├── yii2\n```\n\n## By composer\n\n```\ncomposer require koolreport/yii2\n```\n\n# Documentation\n\n## Step-by-step tutorial\n\n#### Step 1: Create report and claim friendship with Laravel\n\n1. First, you create folder `reports` inside root folder\n2. Inside reports folder, create two files `MyReport.php` and `MyReport.view.php`\n3. Adding `use \\koolreport\\yii2\\Friendship` to your report like following\n\n`MyReport.php`\n\n```\n\u003c?php\nnamespace app\\reports;\n\nclass MyReport extends \\koolreport\\KoolReport\n{\n    use \\koolreport\\yii2\\Friendship;\n    // By adding above statement, you have claim the friendship between two frameworks\n    // As a result, this report will be able to accessed all databases of Yii2\n    // There are no need to define the settings() function anymore\n    // while you can do so if you have other datasources rather than those\n    // defined in Laravel.\n    \n\n    function setup()\n    {\n        $this-\u003esrc(\"default\")\n        -\u003equery(\"SELECT * FROM offices\")\n        -\u003epipe($this-\u003edataStore(\"offices\"));        \n    }\n}\n```\n\n`MyReport.view.php`\n\n```\n\u003c?php\nuse \\koolreport\\widgets\\koolphp\\Table;\n?\u003e\n\u003chtml\u003e\n    \u003chead\u003e\n    \u003ctitle\u003eMy Report\u003c/title\u003e\n    \u003c/head\u003e\n    \u003cbody\u003e\n        \u003ch1\u003eIt works\u003c/h1\u003e\n        \u003c?php\n        Table::create([\n            \"dataSource\"=\u003e$this-\u003edataStore(\"offices\")\n        ]);\n        ?\u003e\n    \u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### Step 2: Run report and display report\n\nNow you have MyReport ready, in order to get report display inside Yii2, you will create MyReport's object in controller and pass that object to the view to render.\n\n\n`HomeController.php`\n\n```\n\u003c?php\n\nnamespace app\\controllers;\n\nuse Yii;\nuse yii\\filters\\AccessControl;\nuse yii\\web\\Controller;\nuse yii\\web\\Response;\nuse yii\\filters\\VerbFilter;\nuse app\\models\\LoginForm;\nuse app\\models\\ContactForm;\n\nclass SiteController extends Controller\n{\n    ...\n    public function actionReport()\n    {\n        $report = new \\app\\reports\\MyReport;\n        $report-\u003erun();\n        return $this-\u003erender('report',array(\n            \"report\"=\u003e$report\n        ));\n        \n    }\n}\n```\n\n`report.php`\n\n```\n\u003c?php $report-\u003erender(); ?\u003e\n```\n\n# Support\n\nPlease 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__.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoolreport%2Fyii2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoolreport%2Fyii2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoolreport%2Fyii2/lists"}