{"id":20207070,"url":"https://github.com/koolreport/platesphp","last_synced_at":"2025-03-03T09:44:50.055Z","repository":{"id":57008512,"uuid":"187561792","full_name":"koolreport/platesphp","owner":"koolreport","description":"Use platesphp as template engine","archived":false,"fork":false,"pushed_at":"2020-11-10T15:59:23.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-13T20:49:55.346Z","etag":null,"topics":["mysql-reporting-tools","php-reporting-tools","php-reports","plates-templates","reporting-engine","template-engine"],"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":"2019-05-20T03:29:26.000Z","updated_at":"2020-11-10T15:59:25.000Z","dependencies_parsed_at":"2022-08-21T13:10:11.873Z","dependency_job_id":null,"html_url":"https://github.com/koolreport/platesphp","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koolreport%2Fplatesphp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koolreport%2Fplatesphp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koolreport%2Fplatesphp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koolreport%2Fplatesphp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koolreport","download_url":"https://codeload.github.com/koolreport/platesphp/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":["mysql-reporting-tools","php-reporting-tools","php-reports","plates-templates","reporting-engine","template-engine"],"created_at":"2024-11-14T05:27:20.314Z","updated_at":"2025-03-03T09:44:50.019Z","avatar_url":"https://github.com/koolreport.png","language":"PHP","readme":"# PlatesPHP\n\n## Overview\n\nStarting from version 4.0.0, KoolReport supports other template engines rather than just its own template view file and `PlatesPhp` is one of them.\n\nPlates is a native PHP template system that’s fast, easy to use and easy to extend. It’s inspired by the excellent Twig template engine and strives to bring modern template language functionality to native PHP templates. Plates is designed for developers who prefer to use native PHP templates over compiled template languages, such as Twig or Smarty.\n\n#### Highlight\n\n* Native PHP templates, no new syntax to learn\n* Plates is a template system, not a template language\n* Plates encourages the use of existing PHP functions\n* Increase code reuse with template layouts and inheritance\n* Template folders for grouping templates into namespaces\n* Data sharing across templates\n* Preassign data to specific templates\n* Built-in escaping helpers\n* Easy to extend using functions and extensions\n* Framework-agnostic, will work with any project\n* Decoupled design makes templates easy to test\n* Composer ready and PSR-2 compliant\n\nYou may read more information about Plates PHP in [here](https://platesphp.com/).\n\n## Installation\n\n#### By downloading .zip file\n\n1. [Download](https://www.koolreport.com/packages/platesphp)\n2. Unzip the zip file\n3. Copy the folder `platesphp` into `koolreport` folder so that look like below\n\n```bash\nkoolreport\n├── core\n├── platesphp\n```\n\n#### By composer\n\n```\ncomposer require koolreport/platesphp\n```\n\n## Get started\n\n__Step 1:__ First create a folder to hold the views\n\n```bash\nproject/\n├── reports/\n│   └── MyReport.php\n├── views/\n│   └── myreport.phtml\n```\n\n__Step 2:__ Next, in your `MyReport.php` you initiate platesphp template like this:\n\n```\nrequire_once \"../../koolreport/core/autoload.php\";\n\nclass MyReport extends \\koolreport\\KoolReport\n{\n    use \\koolreport\\platesphp\\Engine;\n    \n    protected function platesInit()\n    {\n        return League\\Plates\\Engine::create(dirname(__FILE__).'/../views');\n    }\n    ...\n\n}\n```\n\n__Step 3:__ Create report's view content. In your `myreport.phtml` you can do:\n\n```\n\u003chtml\u003e\n\u003chead\u003e\n    \u003ctitle\u003eMyReport\u003c/title\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n    \u003c?php\n    \\koolreport\\widgets\\koolphp\\Table::create(array(\n        \"dataSource\"=\u003e$report-\u003edataStore(\"result\"),\n    ));\n    ?\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n__*Important Note*:__ You need to use `$report` variable to refer to the report class, not `$this` as you do when use default Koolreport view file.\n\n__Step 4:__ To make the report run and render, you do:\n\n\n```\n//index.php\n\nrequire_once \"MyReport.php\";\n\n$report = new MyReport;\n$report-\u003erun()-\u003erender(\"myreport\"); // You need to specify the view you want to render\n```\n\nNow your report will run and then use `myreport.phtml` to render the view of report. \n\n__Congrat!__\n\n\n# Resources\n\n1. [Full documentation](https://www.koolreport.com/docs/platesphp/overview/)\n2. [Examples \u0026 Demonstration](https://www.koolreport.com/examples)\n\n\n# Support\n\nPlease use [our forum](https://www.koolreport.com/forum/topics) 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](mailto:support@koolreport.com).","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoolreport%2Fplatesphp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoolreport%2Fplatesphp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoolreport%2Fplatesphp/lists"}