Browse files

Update README to reflect preferred mustache class implementation. Ren…

…dering arbitrary generic view class/array and template is secondary.
  • Loading branch information...
1 parent 4059c4d commit fa8c81dcfd04d6b442a94122b59a105d7f5ce082 @bobthecow committed Apr 6, 2010
Showing with 20 additions and 11 deletions.
  1. +20 −11 README.markdown
View
31 README.markdown
@@ -26,10 +26,10 @@ And a more in-depth example--this is the canonical Mustache template:
{{/in_ca}}
-Create a view object--which could also be an associative array, but those don't do functions quite as well:
+Along with the associated Mustache class:
<?php
- class Chris {
+ class Chris extends Mustache {
public $name = "Chris";
public $value = 10000;
@@ -39,21 +39,22 @@ Create a view object--which could also be an associative array, but those don't
public $in_ca = true;
}
- ?>
-And render it:
+Render it like so:
<?php
- $chris = new Chris;
- $m = new Mustache;
- echo $m->render($template, $chris);
+ $c = 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:
+
<?php
- class Chris extends Mustache {
+ class Chris {
public $name = "Chris";
public $value = 10000;
@@ -63,12 +64,20 @@ Here's the same thing, a different way:
public $in_ca = true;
}
-
- $c = new Chris;
- echo $chris->render($template);
?>
+And render it:
+
+ <?php
+ $chris = new Chris;
+ $m = new Mustache;
+ echo $m->render($template, $chris);
+ ?>
+
+
+
+
Known Issues
------------

0 comments on commit fa8c81d

Please sign in to comment.