{"id":42036388,"url":"https://github.com/naingaunglwin-dev/view","last_synced_at":"2026-01-26T05:07:45.659Z","repository":{"id":237937155,"uuid":"752144917","full_name":"naingaunglwin-dev/view","owner":"naingaunglwin-dev","description":"A lightweight template rendering engine with php","archived":false,"fork":false,"pushed_at":"2024-12-22T12:12:37.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-01T01:09:04.807Z","etag":null,"topics":["render","rendering-engine","template-rendering","view"],"latest_commit_sha":null,"homepage":"","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/naingaunglwin-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-02-03T06:40:01.000Z","updated_at":"2025-01-20T17:59:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"aed403a5-af67-40a4-ae7d-e9af930412b9","html_url":"https://github.com/naingaunglwin-dev/view","commit_stats":null,"previous_names":["naingaunglwin-dev/view"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/naingaunglwin-dev/view","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naingaunglwin-dev%2Fview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naingaunglwin-dev%2Fview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naingaunglwin-dev%2Fview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naingaunglwin-dev%2Fview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/naingaunglwin-dev","download_url":"https://codeload.github.com/naingaunglwin-dev/view/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naingaunglwin-dev%2Fview/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28767032,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T03:54:34.369Z","status":"ssl_error","status_checked_at":"2026-01-26T03:54:33.031Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["render","rendering-engine","template-rendering","view"],"created_at":"2026-01-26T05:07:45.021Z","updated_at":"2026-01-26T05:07:45.653Z","avatar_url":"https://github.com/naingaunglwin-dev.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# Simple PHP View Library\n\n![Status](https://img.shields.io/badge/test-pass-green)\n![Status](https://img.shields.io/badge/coverage-100%25-green)\n![License](https://img.shields.io/badge/license-MIT-blue.svg)\n\n\u003c/div\u003e\n\n## Contributing\n- This is an open-source library, and contributions are welcome.\n- If you have any suggestions, bug reports, or feature requests, please open an issue or submit a pull request on the project repository.\n\n## Requirement\n- **PHP** version 8.0 or newer is required\n\n## Installation \u0026 Setup\n- You can just download the code from repo and use or download using composer.\n\n### Download Using Composer\n- If you don't have composer, install [composer](https://getcomposer.org/download/) first.\n- create file `composer.json` at your project root directory.\n- Add this to `composer.json`\n```php\n{\n  \"require\": {\n    \"naingaunglwin-dev/view\": \"^1.0\"\n  }\n}\n```\n- Run the following command in your terminal from the project's root directory:\n```bash\ncomposer install\n```\n- Or just run `composer require naingaunglwin-dev/view` in terminal.\n\n## Usage\n- In your php file,\n```php\n\u003c?php\n\nrequire_once \"vendor/autoload.php\";\n\nuse NAL\\View\\View;\n\n$view = new View(__DIR__ . '/views');\n\n// You can pass view file without extension if it is php file\n$view-\u003erender('index', ['status' =\u003e 'success']);\n\n// You can also render other file,\n// You can retrieve the view without rendering,\n$indexView = $view-\u003erender('index.html', [], true);\n\n// You can also render multi views\n$view-\u003erender(['index.html, test']);\n```\n\n- If you don't define your view path, View class will automatically set the view path to your project root level\n\n### Section Usage\n- create `one.php` and `two.php`\n  \n- one.php\n```php\n\u003c?php //one.php\n\necho 'this is one.php';\n$this-\u003eyield('content');\n```\n\n- two.php\n```php\n\u003c?php //two.php\n$this-\u003eextends('one'); // view file name that need to extend\n\n$this-\u003esection('content'); // Section start with `content` name\n\necho '\u003cbr\u003eThis is section content from two.php';\n\n$this-\u003eend('content'); // End the section `content`\n```\n\n- index.php\n```php\n\u003c?php\n\nrequire_once \"vendor/autoload.php\";\n\nuse NAL\\View\\View;\n\n$view = new View(__DIR__ . '/views');\n\n$view-\u003erender('two');\n```\n\n- Output will be\n```txt\nthis is one.php\nThis is section content from two.php\n```\n\n### Custom Renderer Engine\n```php\n\u003c?php\n$view = new \\NAL\\View\\View('path', MyCustomEngine::class);\n\n$view-\u003erender('template'); // MyCustomEngine`s render method will be used in this process if exists\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaingaunglwin-dev%2Fview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnaingaunglwin-dev%2Fview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaingaunglwin-dev%2Fview/lists"}