{"id":15296225,"url":"https://github.com/anovsiradj/php-cutter","last_synced_at":"2026-05-14T21:03:46.234Z","repository":{"id":56948592,"uuid":"71988779","full_name":"anovsiradj/php-cutter","owner":"anovsiradj","description":"Flexible Template Library","archived":false,"fork":false,"pushed_at":"2024-06-10T01:26:10.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-20T06:46:40.616Z","etag":null,"topics":["composer","php","php-library","php5","php7","php8","template-library"],"latest_commit_sha":null,"homepage":"","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/anovsiradj.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,"zenodo":null}},"created_at":"2016-10-26T09:40:15.000Z","updated_at":"2024-06-10T01:31:29.000Z","dependencies_parsed_at":"2025-05-29T05:38:56.427Z","dependency_job_id":"ab64ac1b-38e7-4b73-8444-cf0eb993d236","html_url":"https://github.com/anovsiradj/php-cutter","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/anovsiradj/php-cutter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anovsiradj%2Fphp-cutter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anovsiradj%2Fphp-cutter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anovsiradj%2Fphp-cutter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anovsiradj%2Fphp-cutter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anovsiradj","download_url":"https://codeload.github.com/anovsiradj/php-cutter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anovsiradj%2Fphp-cutter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33043249,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"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":["composer","php","php-library","php5","php7","php8","template-library"],"created_at":"2024-09-30T18:09:47.670Z","updated_at":"2026-05-14T21:03:46.193Z","avatar_url":"https://github.com/anovsiradj.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cutter\n\nFlexible Template Library. Inspired by Blade (Laravel) and Twig (Symfony).\n\nTested on PHP `5.6`, `~7` and `~8`.\n\n## Installation\n\n[Download this source](/anovsiradj/php-cutter/releases) or via [Composer](https://packagist.org/packages/anovsiradj/cutter):\n\n```cmd\ncomposer require anovsiradj/cutter\n```\n\n## Example\n\n`/index.php`\n\n```php\nrequire 'Cutter.php'; // directly or composer\n\n$cutter = new anovsiradj\\Cutter;\n$cutter-\u003eset('layout','/layouts/main');\n\n$cutter-\u003edata('page_title', 'My Posts'); // set variable\n\n$cutter-\u003eview(\n\t'/pages/home',\n\t['date_today' =\u003e date('Y-m-d')], // set variable(s)\n);\n```\n\n`/layouts/main.php`\n\nuse `section()` to define section\n\n```php\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\t\u003chead\u003e\n\t\t\u003ctitle\u003e\u003c?= $page_title ?\u003e\u003c/title\u003e\n\t\u003c/head\u003e\n\n\t\u003cbody\u003e\n\t\t\u003cdiv\u003e\n\t\t\t\u003c?php $cutter-\u003esection('content') ?\u003e\n\t\t\u003cdiv\u003e\n\n\t\t\u003c?php $cutter-\u003esection('script') ?\u003e\n\t\u003c/body\u003e\n\u003c/html\u003e\n```\n\n`/pages/home.php`\n\nuse `begin()` and `end()` to output-buffer section\n\n```php\n\u003c?php $this-\u003ebegin('content') ?\u003e\n\u003cul\u003e\n\t\u003cli\u003ePost title 1\u003c/li\u003e\n\t\u003cli\u003ePost title 2\u003c/li\u003e\n\t\u003cli\u003ePost title 3\u003c/li\u003e\n\u003c/ul\u003e\n\u003c?php $this-\u003eend() ?\u003e\n\n\u003c?php $this-\u003ebegin('script') ?\u003e\n\u003cscript\u003ealert('date today is \u003c?php echo $date_today ?\u003e')\u003c/script\u003e\n\u003c?php $this-\u003eend() ?\u003e\n```\n\nfor more, see `/example/`.\n\n## Reference\n\n**Class Methods**\n\n```php\nget( $key ) : void;\nset( $key, mixed $val ) : void;\n\ndata( mixed $any [, mixed $val] ): mixed;\n\nload( $file [, bool $isob = false] ): void;\n\nview( mixed $name [, array $data = [] [, bool $render = true ] ] ) : void;\n\nrender( [array $data = [] ] ) : void;\n\nsection( $name ) : bool;\n\nbegin( $name ) : void;\nend(): void\n```\n\n## Development\n\nTODO:\n- single file library / phar?\n- inheritance\n- ~~dynamic path~~\n- ~~dynamic view~~\n\nAll suggestions are welcome. Thanks.\n\n## Reference\n\n- https://laravel.com/docs/5.8/blade\n- https://twig.symfony.com/doc/2.x/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanovsiradj%2Fphp-cutter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanovsiradj%2Fphp-cutter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanovsiradj%2Fphp-cutter/lists"}