Mustache.php
============
A [Mustache](http://mustache.github.com/) implementation in PHP.
[![Package version](http://img.shields.io/packagist/v/mustache/mustache.svg?style=flat-square)](https://packagist.org/packages/mustache/mustache)
[![Build status](http://img.shields.io/travis/bobthecow/mustache.php/dev.svg?style=flat-square)](http://travis-ci.org/bobthecow/mustache.php)
[![StyleCI](https://styleci.io/repos/569670/shield)](https://styleci.io/repos/569670)
[![Monthly downloads](http://img.shields.io/packagist/dm/mustache/mustache.svg?style=flat-square)](https://packagist.org/packages/mustache/mustache)
Usage
-----
A quick example:
```php
<?php
$m = new Mustache_Engine;
echo $m->render('Hello {{planet}}', array('planet' => 'World!')); // "Hello World!"
```
And a more in-depth example -- this is the canonical Mustache template:
```html+jinja
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
<?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
<?php
$m = new Mustache_Engine;
$chris = new Chris;
echo $m->render($template, $chris);
```
And That's Not All!
-------------------
Read [the Mustache.php documentation](https://github.com/bobthecow/mustache.php/wiki/Home) for more information.
See Also
--------
* [Readme for the Ruby Mustache implementation](http://github.com/defunkt/mustache/blob/master/README.md).
* [mustache(5)](http://mustache.github.com/mustache.5.html) man page.
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
Mustache: PHP实现的Mustache模板语言类库 (177个子文件)
phpunit.xml.dist 550B
.gitignore 48B
.gitmodules 178B
composer.json 657B
LICENSE 1KB
CONTRIBUTING.md 2KB
README.md 2KB
alpha.ms 14B
beta.ms 13B
complex.mustache 265B
grand_parent_context.mustache 200B
whitespace.mustache 186B
sections_nested.mustache 134B
dot_notation.mustache 128B
child_context.mustache 113B
simple.mustache 105B
delimiters.mustache 94B
filters.mustache 83B
partials.mustache 79B
section_magic_objects.mustache 79B
section_objects.mustache 79B
inverted_section.mustache 75B
blocks.mustache 75B
parent.mustache 71B
header.mustache 68B
sections.mustache 68B
section_iterator_objects.mustache 68B
comments.mustache 66B
i18n.mustache 57B
inverted_double_section.mustache 53B
double_section.mustache 53B
child.mustache 43B
recursive_partials.mustache 38B
second.mustache 34B
third.mustache 33B
nested_partials.mustache 32B
implicit_iterator.mustache 27B
utf8_unescaped.mustache 26B
utf8.mustache 24B
unescaped.mustache 20B
escaped.mustache 18B
two.mustache 12B
one.mustache 12B
fourth.mustache 10B
alphabet.mustache 8B
Engine.php 23KB
Compiler.php 22KB
ParserTest.php 17KB
InheritanceTest.php 14KB
TokenizerTest.php 12KB
EngineTest.php 12KB
Parser.php 11KB
Tokenizer.php 10KB
ContextTest.php 8KB
StreamLoggerTest.php 7KB
Context.php 7KB
FiltersTest.php 6KB
StreamLogger.php 5KB
build_bootstrap.php 5KB
CompilerTest.php 5KB
HigherOrderSectionsTest.php 5KB
Template.php 5KB
HelperCollectionTest.php 5KB
FilesystemLoader.php 4KB
FilesystemCache.php 4KB
ExamplesTest.php 4KB
InlineLoader.php 4KB
HelperCollection.php 4KB
Logger.php 3KB
MustacheSpecTest.php 3KB
StrictCallablesTest.php 3KB
AbstractLogger.php 3KB
FilesystemLoaderTest.php 3KB
ObjectSectionTest.php 2KB
Filters.php 2KB
MustacheInjectionTest.php 2KB
HigherOrderSectionsTest.php 2KB
ArrayLoader.php 2KB
LambdaHelper.php 2KB
MustacheSpecTest.php 2KB
PartialLambdaIndentTest.php 2KB
LambdaHelperTest.php 2KB
AbstractLoggerTest.php 2KB
CascadingLoader.php 2KB
Autoloader.php 2KB
bootstrap.php 2KB
SpecTestCase.php 2KB
AbstractCache.php 1KB
TemplateTest.php 1KB
InlineLoaderTest.php 1KB
ArrayLoaderTest.php 1KB
UnknownTemplateExceptionTest.php 1KB
UnknownFilterExceptionTest.php 1KB
UnknownHelperExceptionTest.php 1KB
EngineTest.php 1KB
CascadingLoaderTest.php 1KB
SyntaxExceptionTest.php 1KB
SectionsNested.php 1KB
FunctionalTestCase.php 1KB
NestedPartialIndentTest.php 1KB
共 177 条
- 1
- 2
资源评论
reg183
- 粉丝: 1811
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Screenshot_20240427_031602.jpg
- 网页PDF_2024年04月26日 23-46-14_QQ浏览器网页保存_QQ浏览器转格式(6).docx
- 直接插入排序,冒泡排序,直接选择排序.zip
- 在排序2的基础上,再次对快排进行优化,其次增加快排非递归,归并排序,归并排序非递归版.zip
- 实现了7种排序算法.三种复杂度排序.三种nlogn复杂度排序(堆排序,归并排序,快速排序)一种线性复杂度的排序.zip
- 冒泡排序 直接选择排序 直接插入排序 随机快速排序 归并排序 堆排序.zip
- 课设-内部排序算法比较 包括冒泡排序、直接插入排序、简单选择排序、快速排序、希尔排序、归并排序和堆排序.zip
- Python排序算法.zip
- C语言实现直接插入排序、希尔排序、选择排序、冒泡排序、堆排序、快速排序、归并排序、计数排序,并带图详解.zip
- 常用工具集参考用于图像等数据处理
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功