定制 plesk/mustache 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

plesk/mustache

最新稳定版本:2.14.3

Composer 安装命令:

composer require plesk/mustache

包简介

A Mustache implementation in PHP.

README 文档

README

A Mustache implementation in PHP.

Package version Monthly downloads

Installation

composer require plesk/mustache 

Usage

A quick example:

<?php $m = new Mustache_Engine(array('entity_flags' => ENT_QUOTES)); echo $m->render('Hello {{planet}}', array('planet' => 'World!')); // "Hello World!"

And a more in-depth example -- this is the canonical Mustache template:

Hello {{name}} You have just won {{value}} dollars! {{#in_ca}} Well, {{taxed_value}} dollars, after taxes. {{/in_ca}}

Create a view "context" object -- which could also be an associative array, but those don't do functions quite as well:

<?php class Chris { public $name = "Chris"; public $value = 10000; public function taxed_value() { return $this->value - ($this->value * 0.4); } public $in_ca = true; }

And render it:

<?php $m = new Mustache_Engine(array('entity_flags' => ENT_QUOTES)); $chris = new Chris; echo $m->render($template, $chris);

Note: we recommend using ENT_QUOTES as a default of entity_flags to decrease the chance of Cross-site scripting vulnerability.

And That's Not All!

Read the Mustache.php documentation for more information.

See Also

统计信息

  • 总下载量: 3.43k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 437
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固