{"id":13700032,"url":"https://github.com/jbboehr/php-mustache","last_synced_at":"2025-05-07T19:23:41.800Z","repository":{"id":2569015,"uuid":"3548892","full_name":"jbboehr/php-mustache","owner":"jbboehr","description":"Mustache PHP Extension","archived":false,"fork":false,"pushed_at":"2024-09-28T06:35:46.000Z","size":603,"stargazers_count":56,"open_issues_count":2,"forks_count":22,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-31T13:18:50.328Z","etag":null,"topics":["c-plus-plus","mustache","php","php-extension","php-mustache"],"latest_commit_sha":null,"homepage":"","language":"C++","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/jbboehr.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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":"2012-02-26T01:10:13.000Z","updated_at":"2024-09-28T06:35:49.000Z","dependencies_parsed_at":"2024-10-22T21:31:16.908Z","dependency_job_id":null,"html_url":"https://github.com/jbboehr/php-mustache","commit_stats":{"total_commits":316,"total_committers":11,"mean_commits":"28.727272727272727","dds":"0.22468354430379744","last_synced_commit":"604f56973aebfbbda5a7de74518aec36df027dc4"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbboehr%2Fphp-mustache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbboehr%2Fphp-mustache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbboehr%2Fphp-mustache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbboehr%2Fphp-mustache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jbboehr","download_url":"https://codeload.github.com/jbboehr/php-mustache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252941964,"owners_count":21828971,"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":["c-plus-plus","mustache","php","php-extension","php-mustache"],"created_at":"2024-08-02T20:00:47.549Z","updated_at":"2025-05-07T19:23:41.778Z","avatar_url":"https://github.com/jbboehr.png","language":"C++","funding_links":[],"categories":["框架组件"],"sub_categories":[],"readme":"# php-mustache\n\n[![GitHub Build Status](https://github.com/jbboehr/php-mustache/workflows/ci/badge.svg)](https://github.com/jbboehr/php-mustache/actions?query=workflow%3Aci)\n[![Coverage Status](https://coveralls.io/repos/jbboehr/php-mustache/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/jbboehr/php-mustache?branch=master)\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](LICENSE.md)\n\nC++ implementation of [Mustache](http://mustache.github.com/) as a PHP extension.\n\n## Features\n\nAll features of Mustache are supported EXCEPT:\n\n* Whitespace rules. All whitespace is kept as it is in the input template.\n\n## Installation\n\n### Linux/OSX\n\n#### Source\n\nPrerequisite packages are:\n\n* PHP development headers and tools\n* `gcc` \u003e= 4.4 | `clang` \u003e= 3.x | `vc` \u003e= 11\n* GNU `make` \u003e= 3.81\n* `automake`\n* `autoconf`\n* [`libmustache`](https://github.com/jbboehr/libmustache)\n\n``` sh\ngit clone git://github.com/jbboehr/php-mustache.git --recursive\ncd php-mustache\nphpize\n./configure --enable-mustache\nmake\nsudo make install\n```\n\nAdd the extension to your *php.ini*:\n\n```ini\necho extension=mustache.so | tee -a /path/to/your/php.ini\n```\n\n### Fedora/RHEL/CentOS\n\nRPM packages of the extension are available in [Remi's repository](https://rpms.remirepo.net/).\n\n**Fedora** (change 24 to match your Fedora version)\n\n``` sh\ndnf install https://rpms.remirepo.net/fedora/remi-release-24.rpm\ndnf install --enablerepo=remi php-pecl-mustache\n```\n\n**RHEL/CentOS** (for default PHP in base repository)\n\n``` sh\nyum install https://rpms.remirepo.net/enterprise/remi-release-7.rpm\nyum install php-pecl-mustache\n```\n\n### Nix/NixOS\n\n``` sh\nnix-env -i -f https://github.com/jbboehr/php-mustache/archive/master.tar.gz\n```\n\n### Windows\n\nSee [Build your own PHP on Windows](https://wiki.php.net/internals/windows/stepbystepbuild). You may need to add [msinttypes](https://code.google.com/p/msinttypes/) ([export](https://github.com/jbboehr/msinttypes/)) to your include directory.\n\n## Usage\n\nExample:\n\n```php\n\u003c?php\n$mustache = new Mustache();\n$tmpl = \u003c\u003c\u003cEOF\nHello {{name}}\nYou have just won {{value}} dollars!\n{{#in_ca}}\nWell, {{taxed_value}} dollars, after taxes.\n{{/in_ca}}\nEOF;\n$data = array(\n  'name' =\u003e 'John',\n  'value' =\u003e 10000,\n  'taxed_value' =\u003e 10000 * 0.6,\n  'in_ca' =\u003e true,\n);\n$partials = array();\necho $mustache-\u003erender($tmpl, $data, $partials);\n```\n\nProduces:\n\n```text\nHello John\nYou have just won 10000 dollars!\n\nWell, 6000 dollars, after taxes.\n\n```\n\nSee also: [template loader example](examples.md)\n\n## Credits\n\n* [John Boehr](https://github.com/jbboehr)\n* [Adam Baratz](https://github.com/adambaratz)\n* [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbboehr%2Fphp-mustache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjbboehr%2Fphp-mustache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbboehr%2Fphp-mustache/lists"}