{"id":13562944,"url":"https://github.com/bobthecow/mustache.php","last_synced_at":"2025-05-13T15:09:11.132Z","repository":{"id":844438,"uuid":"569670","full_name":"bobthecow/mustache.php","owner":"bobthecow","description":"A Mustache implementation in PHP.","archived":false,"fork":false,"pushed_at":"2024-08-13T12:45:43.000Z","size":1060,"stargazers_count":3251,"open_issues_count":44,"forks_count":433,"subscribers_count":111,"default_branch":"main","last_synced_at":"2025-05-08T20:12:20.050Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://mustache.github.io/","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/bobthecow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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}},"created_at":"2010-03-19T10:58:58.000Z","updated_at":"2025-05-08T09:30:21.000Z","dependencies_parsed_at":"2024-06-18T10:37:20.443Z","dependency_job_id":"ae994a2b-8a1e-4907-a876-b754058ea814","html_url":"https://github.com/bobthecow/mustache.php","commit_stats":{"total_commits":664,"total_committers":52,"mean_commits":12.76923076923077,"dds":"0.21385542168674698","last_synced_commit":"23f43cded6ca7fb0d296df95ce744a843d744631"},"previous_names":[],"tags_count":50,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobthecow%2Fmustache.php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobthecow%2Fmustache.php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobthecow%2Fmustache.php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobthecow%2Fmustache.php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bobthecow","download_url":"https://codeload.github.com/bobthecow/mustache.php/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253336068,"owners_count":21892781,"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":[],"created_at":"2024-08-01T13:01:13.680Z","updated_at":"2025-05-13T15:09:06.116Z","avatar_url":"https://github.com/bobthecow.png","language":"PHP","readme":"Mustache.php\n============\n\nA [Mustache](https://mustache.github.io/) implementation in PHP.\n\n[![Package version](http://img.shields.io/packagist/v/mustache/mustache.svg?style=flat-square)](https://packagist.org/packages/mustache/mustache)\n[![Monthly downloads](http://img.shields.io/packagist/dm/mustache/mustache.svg?style=flat-square)](https://packagist.org/packages/mustache/mustache)\n\nInstallation\n------------\n```\ncomposer require mustache/mustache\n```\n\nUsage\n-----\n\nA quick example:\n\n```php\n\u003c?php\n$m = new Mustache_Engine(array('entity_flags' =\u003e ENT_QUOTES));\necho $m-\u003erender('Hello {{planet}}', array('planet' =\u003e 'World!')); // \"Hello World!\"\n```\n\n\nAnd a more in-depth example -- this is the canonical Mustache template:\n\n```html+jinja\nHello {{name}}\nYou have just won {{value}} dollars!\n{{#in_ca}}\nWell, {{taxed_value}} dollars, after taxes.\n{{/in_ca}}\n```\n\n\nCreate a view \"context\" object -- which could also be an associative array, but those don't do functions quite as well:\n\n```php\n\u003c?php\nclass Chris {\n    public $name  = \"Chris\";\n    public $value = 10000;\n\n    public function taxed_value() {\n        return $this-\u003evalue - ($this-\u003evalue * 0.4);\n    }\n\n    public $in_ca = true;\n}\n```\n\n\nAnd render it:\n\n```php\n\u003c?php\n$m = new Mustache_Engine(array('entity_flags' =\u003e ENT_QUOTES));\n$chris = new Chris;\necho $m-\u003erender($template, $chris);\n```\n\n*Note:* we recommend using `ENT_QUOTES` as a default of [entity_flags](https://github.com/bobthecow/mustache.php/wiki#entity_flags) to decrease the chance of Cross-site scripting vulnerability.\n\nAnd That's Not All!\n-------------------\n\nRead [the Mustache.php documentation](https://github.com/bobthecow/mustache.php/wiki/Home) for more information.\n\n\nSee Also\n--------\n\n * [mustache(5)](http://mustache.github.io/mustache.5.html) man page.\n * [Readme for the Ruby Mustache implementation](http://github.com/defunkt/mustache/blob/master/README.md).\n","funding_links":[],"categories":["Templating","模板","PHP","模板 Templating","Table of Contents","目录","模板引擎( Templating )","类库"],"sub_categories":["Templating","模板 Templating","模板引擎"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbobthecow%2Fmustache.php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbobthecow%2Fmustache.php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbobthecow%2Fmustache.php/lists"}