Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

1.2.1

phly/mustache 1.2.1
Total issues resolved: **1**

- [25: Heirarchical templates with same parents use the results of the first render returning for subsequent renderings](#25)

1.2.0

Version 1.2.0 - 31 July 2012
- Added Resolver API
  - Resolvers return mustache syntax, or mustache tokens
  - Mustache class now proxies to Resolvers instead of incorporating
    that functionality
  - DefaultResolver allows specifying suffix, path stack additions, and
    directory separator character (allowing "foo.bar" to resolve to
    "foo/bar.mustache")
- Fixes to hierarchical templates
  - Fixes an issue wherein placeholders nested more than one level deep
    did not propagate to all parents.
- Documentation
  - New end-user documentation (thanks to @harikt and readthedocs.org)
  - API documentation (generated by phpdoc)
  - New website landing page (http://weierophinney.github.com/phly_mustache)
- Travis-CI integration

1.1.0

Adds two new features:
 - Dot notation (originally added in mustache.js). Allows using dot notation in
   variable names, which will then dereference nested objects and/or
   multi-dimensional array views. As an example:

    {{foo.bar}}

   as a template can then be injected with one of the following views:

    $view = array('foo' => array('bar' => 'baz'));

    $view = new stdClass;
    $view->foo = new stdClass;
    $view->foo->bar = 'baz';

   or any combination of nested objects or arrays.

 - Hierarchical templates. This adds two new token types to the grammar, the
   placeholder ("$") and the child view template ("<"). This is best understood
   through an illustration:

    <!-- super.mustache -->
    <html>
    <head><title>{{$title}}Default title{{/title}}</title></head>
    <body>
    <div class="content">
    {{$content}}Default content of the page{{/content}}
    </div>
    {{$footer}}
    <footer>Default footer</footer>
    {{/footer}
    </body>
    </html>

    <!-- sub.mustache -->
    {{<super}}
    {{$title}}Profile of {{username}}{{/title}}
    {{$content}}
    Here is {{username}}'s profile page
    {{/content}}
    {{/super}}

   Given a view that defines "username" as "Matthew, the following output will
   be generated:

    <html>
    <head><title>Profile of Matthew</title></head>
    <body>
    <div class="content">
    Here is Matthew's profile page
    </div>
    <footer>Default footer</footer>
    </body>
    </html>

   Placeholders that are not overridden in the child will receive the default
   value; if the placeholder is overridden in the child, then that value will
   be used. The value may contain mustache tokens, in which case they will be
   rendered using the current view scope.

   Hierarchical views may be arbitrarily nested.

1.0.0

Phly\Mustache is a Mustache (http://mustache.github.com) implementati…
…on written

for PHP 5.3+. It conforms to the principles of mustache, and allows for
extension of the format via pragmas.

Phly\Mustache consists of four primary classes:

- Lexer: tokenizes a template
- Renderer: renders a list of tokens, using substitions provided via a view
- Pragma: interface for pragmas, which may modify how tokens are handled
- Mustache: facade/gateway class. Tokenizes and renders templates, caches
  tokens, provides partial aliasing, and acts as primary interface for
  end-users.

The 1.0.0 version provides:

- The above classes
- An autoloader
- Pragma support, including:
  - IMPLICIT-ITERATOR (iteration of indexed arrays or Traversable objects with
    scalar values, with the option of specifying the iterator "key" to use
    within the template)
  - SUB-VIEWS (allows implementing N-step view patterns)

1.0.0rc3

1.0.0 - Third RC
- Further fixes potential security vectors via callbacks composed in a view
  (reported and fixed by Andy Thompson)

1.0.0rc2

1.0.0 - Second RC
- Fixes a potential security vector (reported by Mark Baker)

1.0.0rc1

At this time, phly_mustache is feature complete.
The following tasks still exist, but should not affect the API:

 - Better handling of whitespace stripping. It works, but still presents some
   odd indentation in isolated instances.
 - Should the full text matched be kept with each token? This really only
   benefits those debugging the lexer and/or renderer.
 - Unit tests for tokenization; these may be dependent on the above items,
   however. Tokenization is implicitly tested via the test suite at this time.
Something went wrong with that request. Please try again.