{"id":33976989,"url":"https://github.com/kykurniawan/rangkai","last_synced_at":"2026-06-08T14:31:39.978Z","repository":{"id":57675730,"uuid":"457054669","full_name":"kykurniawan/rangkai","owner":"kykurniawan","description":"A Minimalistic PHP Layouting Library","archived":false,"fork":false,"pushed_at":"2022-04-22T08:02:22.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-11T12:33:05.314Z","etag":null,"topics":["layout-engine","php"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/gumbili/rangkai","language":"PHP","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/kykurniawan.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":"2022-02-08T18:27:03.000Z","updated_at":"2022-04-22T07:47:27.000Z","dependencies_parsed_at":"2022-09-26T20:41:40.930Z","dependency_job_id":null,"html_url":"https://github.com/kykurniawan/rangkai","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/kykurniawan/rangkai","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kykurniawan%2Frangkai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kykurniawan%2Frangkai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kykurniawan%2Frangkai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kykurniawan%2Frangkai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kykurniawan","download_url":"https://codeload.github.com/kykurniawan/rangkai/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kykurniawan%2Frangkai/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34067348,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["layout-engine","php"],"created_at":"2025-12-13T02:04:41.496Z","updated_at":"2026-06-08T14:31:39.966Z","avatar_url":"https://github.com/kykurniawan.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## A Minimalistic PHP Layouting Library\n\n\u003e **Rangkai** is a layouting library extracted from a popular framework: CodeIgniter 4. **Rangkai** made to be reused for the process of layouting and rendering pages in the [BuahNaga web framework](https://github.com/gumbili/buahnaga).\n\n### Installing Rangkai\n\nYou can easily add the Rangkai Library to your PHP project by running composer installation command like this:\n```bash\ncomposer require kykurniawan/rangkai\n```\nMake sure you are load the autoload file from vendor folder.\nWhen it is installed, you can display the page in the following way.\n```php\n\u003c?php\n\nuse Kykurniawan\\Rangkai\\Rangkai;\n\n// Create new Rangkai instance with provided views path where we store the view file.\n$rangkai = new Rangkai('Views');\n// Set some data to our view\n$rangkai-\u003esetData(['name' =\u003e 'Gumbili Project']);\n// Display our view with echo\n// Note: \"page\" is file path relative to views path\n// if your page in Views/home/page.php, you should use \"home/page\" instead of \"page\"\necho $rangkai-\u003erender('page');\n\n?\u003e\n```\n### Layouting\n\nRangkai provide basic layouting for your project, simple but useful.\n\n#### Ceeating A Layout\n\nTo creating layout, create new PHP file in your views folder before (defined when creating new Rangkai instance)\n\n```html\n\u003c!-- layout.php --\u003e\n\n\u003chtml\u003e\n    \u003chead\u003e\n        \u003ctitle\u003eRangkai\u003c/title\u003e\n    \u003c/head\u003e\n    \u003cbody\u003e\n        \u003cheader\u003e\n            \u003c!-- Assume your header here --\u003e\n        \u003c/header\u003e\n        \u003cmain\u003e\n            \u003c!-- Here we will place the content --\u003e\n            \u003c?php $this-\u003erenderSection('content') ?\u003e\n        \u003c/main\u003e\n        \u003cfooter\u003e\n            \u003c!-- Assume your footer here --\u003e\n        \u003c/footer\u003e\n    \u003c/body\u003e\n\u003c/html\u003e\n```\n#### Extending Layout\n\n```html\n\u003c!-- home.php --\u003e\n\u003c?php $this-\u003eextend('layout') ?\u003e\n\n\u003c?php $this-\u003esection('content') ?\u003e\n\u003cdiv\u003e\n    \u003ch1\u003eHello World!\u003c/h1\u003e\n\u003c/div\u003e\n\u003c?php $this-\u003eendSection() ?\u003e\n```\n\n#### Including Layout\nTo including layout, simply write a line of code described in the example bellow\n```php\n\u003c?php $this-\u003einclude('path to your view file without extension') ?\u003e\n```\nExample:\n```html\n\u003c!-- layout.php --\u003e\n\n\u003chtml\u003e\n    \u003chead\u003e\n        \u003ctitle\u003eRangkai\u003c/title\u003e\n    \u003c/head\u003e\n    \u003cbody\u003e\n        \u003cheader\u003e\n            \u003c!-- We are including header here --\u003e\n            \u003c?php $this-\u003einclude('header') ?\u003e\n        \u003c/header\u003e\n        \u003cmain\u003e\n            \u003c!-- Here we will place the content --\u003e\n            \u003c?php $this-\u003erenderSection('content') ?\u003e\n        \u003c/main\u003e\n        \u003cfooter\u003e\n            \u003c!-- We are including footer here --\u003e\n            \u003c?php $this-\u003einclude('footer') ?\u003e\n        \u003c/footer\u003e\n    \u003c/body\u003e\n\u003c/html\u003e\n```\n\n### License\n```\nMIT License\n\nCopyright (c) 2022 Gumbili Project\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkykurniawan%2Frangkai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkykurniawan%2Frangkai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkykurniawan%2Frangkai/lists"}