push some whitespace around a bit.
This commit is contained in:
+4
-5
@@ -15,7 +15,6 @@ include('Mustache.php');
|
||||
$m = new Mustache;
|
||||
echo $m->render('Hello {{planet}}', array('planet' => 'World!'));
|
||||
// "Hello World!"
|
||||
|
||||
```
|
||||
|
||||
|
||||
@@ -29,6 +28,7 @@ Well, ${{taxed_value}}, after taxes.
|
||||
{{/in_ca}}
|
||||
```
|
||||
|
||||
|
||||
Along with the associated Mustache class:
|
||||
|
||||
```php
|
||||
@@ -43,18 +43,18 @@ class Chris extends Mustache {
|
||||
|
||||
public $in_ca = true;
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
|
||||
Render it like so:
|
||||
|
||||
```php
|
||||
<?php
|
||||
$chris = new Chris;
|
||||
echo $chris->render($template);
|
||||
|
||||
```
|
||||
|
||||
|
||||
Here's the same thing, a different way:
|
||||
|
||||
Create a view object--which could also be an associative array, but those don't do functions quite as well:
|
||||
@@ -71,9 +71,9 @@ class Chris {
|
||||
|
||||
public $in_ca = true;
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
|
||||
And render it:
|
||||
|
||||
```php
|
||||
@@ -81,7 +81,6 @@ And render it:
|
||||
$chris = new Chris;
|
||||
$m = new Mustache;
|
||||
echo $m->render($template, $chris);
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user